1

I am working on a Magento 2.1.2 project, theme Porto. I installed the MageMonkey extension for Mailchimp integration.

I strugle with displaying the messages of successful / unsuccessful subscription to newsletter on the homepage. On local, everything works as intended but on preprod server the afterRenderResult() method of Magento\Theme\Controller\Result\MessagePlugin is not called, so no mage-messages cookie is set.

On preprod if I visit another page, the messages are displayed.

Has anyone had this problem ?

I even have deployed a preprod database on local thinking that the problem is in the database.

Maybe it is a caching problem ?

  • After you created the plugin, have you deleted your var/di and var/generation directories? – Shawn Abramson Oct 21 '16 at 17:29
  • @ShawnAbramson of course. Everything in var/ and pub/static/ – Marin Bînzari Oct 21 '16 at 20:56
0

Maybe you return json response.

I also have problem with it.

I find initial commit when add MessagePlugin https://github.com/magento/magento2/commit/541ec806cae729df118b7844f5d105cbf1a6cec6

This code check is your response is not json

if (!($subject instanceof Json)) {

https://github.com/magento/magento2/blob/develop/app/code/Magento/Theme/Controller/Result/MessagePlugin.php#L83

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.