diff --git a/CHANGELOG.md b/CHANGELOG.md index d287759..8a7755e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# v1.0.10 +## 05/19/2021 + +1. [](#bugfix) + * Fixed `Add Folder` not updating the page list until cache is cleared + * Fixed broken error message translations + # v1.0.9 ## 04/29/2021 diff --git a/blueprints.yaml b/blueprints.yaml index b921d8f..6225c8e 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,7 +1,7 @@ name: Flex Objects slug: flex-objects type: plugin -version: 1.0.9 +version: 1.0.10 description: Flex Objects plugin allows you to manage Flex Objects in Grav Admin. icon: list-alt author: diff --git a/classes/Admin/AdminController.php b/classes/Admin/AdminController.php index c91ad8e..512b8cd 100644 --- a/classes/Admin/AdminController.php +++ b/classes/Admin/AdminController.php @@ -346,7 +346,7 @@ public function taskDelete() $grav->fireEvent('onFlexAfterDelete', new Event(['type' => 'flex', 'object' => $object])); } } catch (RuntimeException $e) { - $this->admin->setMessage($this->admin::translate('PLUGIN_FLEX_OBJECTS.CONTROLLER.TASK_DELETE_FAILURE', $e->getMessage()), 'error'); + $this->admin->setMessage($this->admin::translate(['PLUGIN_FLEX_OBJECTS.CONTROLLER.TASK_DELETE_FAILURE', $e->getMessage()]), 'error'); $this->setRedirect($this->referrerRoute->toString(true), 302); } @@ -416,6 +416,7 @@ public function taskSaveNewFolder(): void Folder::create($new_path); Cache::clearCache('invalidate'); + $directory->getCache('index')->clear(); $this->grav->fireEvent('onAdminAfterSaveAs', new Event(['path' => $new_path])); @@ -575,7 +576,7 @@ protected function taskCopy(): bool $this->setRedirect($this->getFlex()->adminRoute($object)); } catch (RuntimeException $e) { - $this->admin->setMessage($this->admin::translate('PLUGIN_FLEX_OBJECTS.CONTROLLER.TASK_COPY_FAILURE', $e->getMessage()), 'error'); + $this->admin->setMessage($this->admin::translate(['PLUGIN_FLEX_OBJECTS.CONTROLLER.TASK_COPY_FAILURE', $e->getMessage()]), 'error'); $this->setRedirect($this->referrerRoute->toString(true), 302); } @@ -862,7 +863,7 @@ public function taskSave(): bool $grav = Grav::instance(); $grav->fireEvent('onFlexAfterSave', new Event(['type' => 'flex', 'object' => $object])); } catch (RuntimeException $e) { - $this->admin->setMessage($this->admin::translate('PLUGIN_FLEX_OBJECTS.CONTROLLER.TASK_SAVE_FAILURE', $e->getMessage()), 'error'); + $this->admin->setMessage($this->admin::translate(['PLUGIN_FLEX_OBJECTS.CONTROLLER.TASK_SAVE_FAILURE', $e->getMessage()]), 'error'); if (isset($object, $form)) { $data = $form->getData(); @@ -927,7 +928,7 @@ public function taskConfigure(): bool $this->setRedirect($this->referrerRoute->toString(true)); } } catch (RuntimeException $e) { - $this->admin->setMessage($this->admin::translate('PLUGIN_FLEX_OBJECTS.CONTROLLER.TASK_CONFIGURE_FAILURE', $e->getMessage()), 'error'); + $this->admin->setMessage($this->admin::translate(['PLUGIN_FLEX_OBJECTS.CONTROLLER.TASK_CONFIGURE_FAILURE', $e->getMessage()]), 'error'); $this->setRedirect($this->referrerRoute->toString(true), 302); }