From a4be799e2ca99b9c7bb703972b54c5bae9f876d3 Mon Sep 17 00:00:00 2001 From: Chris Pook Date: Mon, 13 Jan 2020 09:57:31 +0000 Subject: [PATCH] Prevent adding Conversion integration placeholder to non CMS page result. --- .../Plugin/Magento/Cms/Controller/Index/IndexPlugin.php | 5 +++++ app/code/MentionMe/MentionMe/etc/module.xml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/code/MentionMe/MentionMe/Plugin/Magento/Cms/Controller/Index/IndexPlugin.php b/app/code/MentionMe/MentionMe/Plugin/Magento/Cms/Controller/Index/IndexPlugin.php index 5d1ddbc..957e15c 100755 --- a/app/code/MentionMe/MentionMe/Plugin/Magento/Cms/Controller/Index/IndexPlugin.php +++ b/app/code/MentionMe/MentionMe/Plugin/Magento/Cms/Controller/Index/IndexPlugin.php @@ -42,6 +42,11 @@ public function __construct( */ public function afterExecute(Index $subject, $result) { + // Prevent adding placeholder to non CMS page result + if (!$result instanceof \Magento\Framework\View\Result\Page) { + return $result; + } + // Only continue if this integration is enabled if ($this->dataHelper->getHomepageConversionMessageEnabled() == false) { return $result; diff --git a/app/code/MentionMe/MentionMe/etc/module.xml b/app/code/MentionMe/MentionMe/etc/module.xml index bb792bc..2bcb64d 100755 --- a/app/code/MentionMe/MentionMe/etc/module.xml +++ b/app/code/MentionMe/MentionMe/etc/module.xml @@ -1,6 +1,6 @@ - +