Standard Joomla! error messages not displayed

  • Posts: 29
  • Thank you received: 2
11 months 1 week ago #350195

-- HikaShop version -- : HikaShop Business 4.7.1 [2301201934]
-- Joomla version -- : 4.2.9
-- PHP version -- : 8.1.12
-- Browser(s) name and version -- : Mozilla Firefox for Ubuntu 111.0 (64-bit)


I have a plugin that handles HikaShop onAfterOrderUpdate events. The logic in the event handler contains a try/catch block. In the catch block, the core Joomla! CMSApplication::enqueueMessage() method is used in an attempt to display texts from any exceptions in the regular Joomla! message area. However, when editing and saving an order in the HikaShop backend, exception messages are never displayed and there is no indication to the user that anything has gone wrong.

What needs to be done to display messages in the default Joomla! message area?

Kind regards,
Pieter-Jan de Vries

Please Log in or Create an account to join the conversation.

  • Posts: 81118
  • Thank you received: 12979
11 months 1 week ago #350205


In the backend, most saves of the order data is done in a popup, which closes itself after, or in an ajax request, without a full refresh of the page being needed.
However, the standard enqueueMessage mechanism requires a full display of the page to display the message.
Supposing the location where the saving occurs allow you to output HTML, you could call the function hikashop_display($msg, 'error'); to directly output the error message.
But that might not be possible. I would need more details on where you're saving the order exactly to be able to tell you what are your options.

Please Log in or Create an account to join the conversation.

Time to create page: 0.054 seconds
Powered by Kunena Forum