0

I encountered this error unexpectedly. How can I find the solution to solve it? This is where error occured

$resultPage->getLayout()->getBlock('messages')->setEscapeMessageFlag(true); 

PHP Fatal error: Uncaught Error: Call to a member function setEscapeMessageFlag() on boolean in /var/www/html/magento2/vendor/magento/module-customer/Controller/Account/Edit.php:83\n Stack trace:\n

#0 /var/www/html/magento2/var/generation/Magento/Customer/Controller/Account/Edit/Interceptor.php(24): Magento\Customer\Controller\Account\Edit->execute()\n

#1 /var/www/html/magento2/vendor/magento/framework/App/Action/Action.php(102): Magento\Customer\Controller\Account\Edit\Interceptor->execute()\n

#2 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))\n

#3 /var/www/html/magento2/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Customer\Controller\Account\Edit\Interceptor->___callParent('dispatch', Array)\n

#4 /var/www/html/magento2/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Custome...', 'dispatch', Object(Magento\Customer\Con in /var/www/html/magento2/vendor/magento/module-customer/Controller/Account/Edit.php on line 83

Mujahidh
2,7825 gold badges41 silver badges87 bronze badges
asked Mar 13, 2017 at 8:12

1 Answer 1

1

This is a known Magento bug:

https://github.com/magento/magento2/issues/4127

Basically if the page lacks page.messages block, it will cause Magento 2 fail with critical error message (dev mode) or white screen of death (production mode). Usually it happens when your layout contains something like this:

<referenceBlock name="page.messages" remove="true"/>

Removing message block is not a good practice anyway, so if you absolutely need to do it, just display empty template file instead.

answered Mar 13, 2017 at 15:18
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.