diff --git a/Block/Category/Listpost.php b/Block/Category/Listpost.php index 0713335d..6e991038 100755 --- a/Block/Category/Listpost.php +++ b/Block/Category/Listpost.php @@ -81,8 +81,8 @@ protected function _prepareLayout() if ($breadcrumbs = $this->getLayout()->getBlock('breadcrumbs')) { $category = $this->getBlogObject(); - $categoryName = preg_replace('/[^A-Za-z0-9\-]/', ' ', $category->getName()); if ($category) { + $categoryName = preg_replace('/[^A-Za-z0-9\-]/', ' ', $category->getName()); $breadcrumbs->addCrumb($category->getUrlKey(), [ 'label' => __($categoryName), 'title' => __($categoryName) diff --git a/Block/Tag/Listpost.php b/Block/Tag/Listpost.php index b7ff284f..1d2cbb1e 100755 --- a/Block/Tag/Listpost.php +++ b/Block/Tag/Listpost.php @@ -82,8 +82,8 @@ protected function _prepareLayout() if ($breadcrumbs = $this->getLayout()->getBlock('breadcrumbs')) { $tag = $this->getBlogObject(); - $tagName = preg_replace('/[^A-Za-z0-9\-]/', ' ', $tag->getName()); if ($tag) { + $tagName = preg_replace('/[^A-Za-z0-9\-]/', ' ', $tag->getName()); $breadcrumbs->addCrumb($tag->getUrlKey(), [ 'label' => __($tagName), 'title' => __($tagName) diff --git a/Block/Topic/Listpost.php b/Block/Topic/Listpost.php index 3c111e96..26d8a749 100755 --- a/Block/Topic/Listpost.php +++ b/Block/Topic/Listpost.php @@ -83,8 +83,8 @@ protected function _prepareLayout() if ($breadcrumbs = $this->getLayout()->getBlock('breadcrumbs')) { $topic = $this->getBlogObject(); - $topicName = preg_replace('/[^A-Za-z0-9\-]/', ' ', $topic->getName()); if ($topic) { + $topicName = preg_replace('/[^A-Za-z0-9\-]/', ' ', $topic->getName()); $breadcrumbs->addCrumb($topic->getUrlKey(), [ 'label' => __($topicName), 'title' => __($topicName) diff --git a/Controller/Adminhtml/Post/Save.php b/Controller/Adminhtml/Post/Save.php index 90322fc4..09cff319 100755 --- a/Controller/Adminhtml/Post/Save.php +++ b/Controller/Adminhtml/Post/Save.php @@ -127,11 +127,11 @@ public function execute() $this->prepareData($post, $data); try { if (empty($action) || $action === 'add') { - $post->save(); $this->_eventManager->dispatch( 'mageplaza_blog_post_prepare_save', ['post' => $post, 'request' => $this->getRequest()] ); + $post->save(); $this->messageManager->addSuccessMessage(__('The post has been saved.')); } $this->addHistory($post, $action); diff --git a/composer.json b/composer.json index 8149f9be..58d88b42 100755 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "mageplaza/facebook-graph-sdk": "^1.0.2" }, "type": "magento2-module", - "version": "4.2.8", + "version": "4.2.8-p0", "license": "proprietary", "keywords": [ "magento 2",