Standard Joomla! error messages not displayed

  • Posts: 29
  • Thank you received: 2
1 year 1 month 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)

Hello,

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: 81481
  • Thank you received: 13062
  • MODERATOR
1 year 1 month ago #350205

Hi,

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.058 seconds
Powered by Kunena Forum