3

After Magento upgrades to its latest version, no success and error messages are seen to be added on the page message section while submitting the newsletter.

But the email gets saved on to the backend

It shows a message when reverted to luma but doesn't work on a custom theme. It was working fine before the update.

Can anyone suggest what might have caused the issue after update?

Sweety Masmiya
1,34211 silver badges21 bronze badges
asked Jul 26, 2016 at 9:49
2
  • Are you getting any JavaScript errors ? Commented Feb 13, 2018 at 17:05
  • check your console, if any error is there or not, if no error then try to see network tab in inspect and search 'section' how many time section got trigger and each section see, i am sure one of working fine but next section update clearing your message. if any update let me know Commented Apr 8, 2018 at 13:05

3 Answers 3

0

For me this issue was being caused by the message block not being present on the page. Try loading other pages that you have modified less.

answered Jul 26, 2016 at 14:55
0
use Magento\Framework\Exception\CouldNotSaveException;
 if(false){
 throw new CouldNotSaveException(__('Error Message'));
 }
answered Apr 29, 2019 at 7:08
0

first you need to add flash massage if (false)

 {
 throw new CouldNotSaveException(__('Error Message'));
 $this->messageManager->addErrorMessage("Somthing went wrong ");
} else {
 $this->messageManager->addSuccessMessage("record add successfully!");
}

second :- check your layout.xml include massage block

<body>
 <referenceContainer name="content">
 <block class="Magento\Framework\View\Element\Messages" name="messages" as="messages" template="Magento_Theme::messages.phtml"/>
 
 </body>
answered May 18, 2024 at 10:35

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.