onPreprocessMenuItems hikashop menu system plugin

  • Posts: 256
  • Thank you received: 2
  • Hikashop Business
5 months 1 week ago #296333

-- HikaShop version -- : 3.5.1
-- Joomla version -- : 3.8.10
-- PHP version -- : 7.2

Hi

we are developing a system plugin that hooks into the onPreprocessMenuItems trigger that was introduced in J 3.7.0 with the development of the new backend menu management. We have a developed a plugin to remove backend menu items such as Configuration when the ACL permissions don't allow the user to view the configuration.

The plugin works correctly but we have noticed an unwanted side effect. In the plugin function onPreprocessMenuItems we have the following code:

if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php'))
        return true;
so we can call hikashop functions such as hikashop_config() and hikahop_isAllowed().
However including these 2 lines of code breaks any joomla language overrides in the backend. Can you help understand why this happens?
Thanks

Last Edit: 5 months 1 week ago by jameswadsworth.

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

  • Posts: 64453
  • Thank you received: 9307
  • MODERATOR
5 months 1 week ago #296341

Hi,

I don't know what com_dacshop is but it's not a HikaShop file you're loading if you have com_dacshop instead of com_hikashop.
I tried to load the helper of HikaShop in a onPreprocessMenuItems trigger of a system plugin and do overrides of com_banner translations and it worked just fine.

Please note that next version of HikaShop will have use that trigger to remove the different menu items based on the ACLs and it won't load the HikaShop helper (to avoid having to load it on every page of the backend which is not really nice).

The following user(s) said Thank You: jameswadsworth

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

  • Posts: 256
  • Thank you received: 2
  • Hikashop Business
5 months 1 week ago #296356

That is great. We look forward to the next version then!

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

Time to create page: 0.081 seconds
Powered by Kunena Forum