From a7a8b7f85527805997b0ebe8988058e9a86a7774 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Mon, 17 Jul 2017 18:36:22 +0200 Subject: [PATCH] Fixes issue when saving pages without a `folder` element [#1163] --- CHANGELOG.md | 8 +++++++- classes/admincontroller.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86db0a34..defbc82a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.5.1 +## 07/xx/2017 + +1. [](#bugfix) + * Fixes issue when saving pages without a `folder` element [#1163](https://github.com/getgrav/grav-plugin-admin/issues/1163) + # v1.5.0 ## 07/16/2017 @@ -7,7 +13,7 @@ * Fixed fetch issue throwing error when request not completed and while unloading the page [#1301](https://github.com/getgrav/grav-plugin-admin/issues/1301) * Fixed ordering when > 100 pages [grav#1564](https://github.com/getgrav/grav/pull/1564) * Fixed Lists issue when reindexing, causing Radio fields to potentially lose their `checked` status ([#1154](https://github.com/getgrav/grav-plugin-admin/issues/1154) | related: [1d55ffc](https://github.com/getgrav/grav-plugin-admin/commit/1d55ffc616125047f245efe9f2180ef2c16b4949)) - + # v1.5.0-rc.4 ## 07/05/2017 diff --git a/classes/admincontroller.php b/classes/admincontroller.php index 1c710594..c78ec156 100644 --- a/classes/admincontroller.php +++ b/classes/admincontroller.php @@ -461,7 +461,7 @@ class AdminController extends AdminBaseController /** @var Page $obj */ $obj = $this->admin->page(true); - if (!$data['folder']) { + if (!isset($data['folder']) || !$data['folder']) { $data['folder'] = $obj->slug(); $this->data['folder'] = $obj->slug(); }