From 84ce56a90e924f4c57ca0d099f0e3075ccac34be Mon Sep 17 00:00:00 2001 From: Awilum Date: Thu, 22 Aug 2019 13:19:25 +0300 Subject: [PATCH] feat(admin-plugin): update Admin plugin #212 #186 update source workflow --- site/plugins/admin/app/Controllers/EntriesController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/site/plugins/admin/app/Controllers/EntriesController.php b/site/plugins/admin/app/Controllers/EntriesController.php index 403ae2fd..5dd3ecc3 100644 --- a/site/plugins/admin/app/Controllers/EntriesController.php +++ b/site/plugins/admin/app/Controllers/EntriesController.php @@ -884,11 +884,14 @@ class EntriesController extends Controller if ($type == 'source') { + // Read entry + $_entry = $this->entries->read($id); + // Data from POST $data = $request->getParsedBody(); // Update entry - if (Filesystem::write(PATH['entries'] . '/' . $id . '/entry.yaml', $data['data'])) { + if ($this->entries->update($id, Parser::decode($data['data'], $_entry['file_parser']))) { $this->flash->addMessage('success', __('admin_message_entry_changes_saved')); } else { $this->flash->addMessage('error', __('admin_message_entry_changes_not_saved'));