Duplicate instances of JLanguage

  • Posts: 5
  • Thank you received: 0
8 years 9 months ago #230501

-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.5.9
-- Browser(s) name and version -- : N/A

Hi,

When I visit many pages I see missing translations, for example:

/administrator/index.php?option=com_config&view=component&component=com_hikashop

I added "xdebug_call_class()" to the JLanguage constructor and two instances are being created, one inside the "JLanguage" class and one inside the "hikaShopLanguage" class. There should only be a single instance of the class in the application.

When "JText::_("JLIB_RULES_SETTINGS_DESC")" is called then it is looking at the last instance, created within hikaShopLanguage, and cannot find the translation because it was loaded in the first instance, which was created inside the Joomla application.


Best regards,

Steffan Harris
Virtual Motorpix
Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 9 months ago #230507

Hi,

If you take a look at the code of hikaShopLanguage, you'll see that the class is copying old strings into his object.
That class allows HikaShop to reload Override files into Joomla ; because in Joomla when you dynamically change the language (like to send an email in another language that the user one), the overrides are not reloaded so you can an email (or a page) with partial correct content.

The class we made is there to create that bridge and it keep all what the previous language class have loaded and done.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: virtualmotorpix

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

  • Posts: 5
  • Thank you received: 0
8 years 9 months ago #230711

Hi Jerome,

Thanks, that's led me on the right track and now I can see one of my system plugins that includes "helper.php" is causing the clash. I have disabled the plugin and the languages now load correctly.


Best regards,

Steffan Harris
Virtual Motorpix

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

Time to create page: 0.037 seconds
Powered by Kunena Forum