From ff974e109b2442ef4936d7e0e38cca7ef50068b8 Mon Sep 17 00:00:00 2001 From: Awilum Date: Tue, 20 Aug 2019 12:44:34 +0300 Subject: [PATCH] feat(admin-plugin): update EntriesController add method #212 #186 - add additional check for $fieldset['parser'] --- site/plugins/admin/app/Controllers/EntriesController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/site/plugins/admin/app/Controllers/EntriesController.php b/site/plugins/admin/app/Controllers/EntriesController.php index 500a6c48..ab1e0525 100644 --- a/site/plugins/admin/app/Controllers/EntriesController.php +++ b/site/plugins/admin/app/Controllers/EntriesController.php @@ -231,8 +231,13 @@ class EntriesController extends Controller $data_result = $data_from_post; } - - if ($this->entries->create($id, $data_result)) { + if (isset($fieldset['parser'])) { + $parser = $fieldset['parser']; + } else { + $parser = 'frontmatter'; + } + + if ($this->entries->create($id, $data_result, $parser)) { $this->flash->addMessage('success', __('admin_message_entry_created')); } else { $this->flash->addMessage('error', __('admin_message_entry_was_not_created'));