Joomla 4 - override not working

  • Posts: 427
  • Thank you received: 19
2 years 2 months ago #344385

-- HikaShop version -- : 4.6.1
-- Joomla version -- : 4.2.2

Hi, I'm trying to do a Joomla 4 override but it's not working. I tested on Jooma 3 works without problems. I did it this way: YOUR_FRONT_END_TEMPLATE/html/com_hikashop/administrator/helpers/dropdown.override.php

Last edit: 2 years 2 months ago by neo191987.

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

  • Posts: 427
  • Thank you received: 19
2 years 2 months ago #344401

The problem lies in this code - /administrator/components/com_hikashop/helpers/helper.php

if((!HIKASHOP_J30 || (isset($app->input) && $app->input->get('Itemid', null) != null)) || hikashop_isClient('administrator')) {

If changed to this code it will work correctly
if((HIKASHOP_J30 || (isset($app->input) && $app->input->get('Itemid', null) != null)) || hikashop_isClient('administrator')) {

I'm testing with the latest version of HikaShop Starter

Last edit: 2 years 2 months ago by neo191987.

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

  • Posts: 427
  • Thank you received: 19
2 years 2 months ago #344421

Am I really not going to get any support even for a free product that I'm using for testing purposes and wasting my time looking for bugs? I'm really already wondering if I should look for other alternative software in the future. :(

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 2 months ago #344389

Hi,

I think changing the line:

if((!HIKASHOP_J30 || (isset($app->input) && $app->input->get('Itemid', null) != null)) || hikashop_isClient('administrator')) {
to:
if(!empty($app) && method_exists($app, 'getTemplate')) {
in the file administrator/components/com_hikashop/helpers/helper.php will fix the problem without creating other issues thanks to the try/catch that was added on the next line after that condition was created when upgrading HikaShop for Joomla 3 support years ago.

That way, we just make sure that $app JApplication is already loaded by Joomla and if it is, we call getTemplate, and if it fails in there (because the template is not yet known), the try/catch should prevent an error.

I did some tests on my end and the change seems to work fine without creating issues. Can you test it on your end ?
If it works for you too, we can include the change for the next version of HikaShop.

The following user(s) said Thank You: neo191987

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 2 months ago #344422

Hi,

I just saw your new message after I posted mine. Please understand that we don't work during weekends. It has nothing to do with free support or not. It's just that it's only been 2 hours that I started working today and only came your your message half an hour ago.

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

  • Posts: 427
  • Thank you received: 19
2 years 2 months ago #344423

Thanks for the reply. If Jerome and Mohamed Thelji have also implemented this code in their apps, overrides no can be applied, so let them look at this thread. Unfortunately I can't test their Joomla 4 bug apps because I can't renew my subscriptions right now but if you provide a demo with Joomla 4 in the near future I will join as a tester because as we all know in 1 year support for Joomla 3 is ending and I think it is in all of our interests to keep the number of bugs to a minimum.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 2 months ago #344424

Hi,

Good idea. I checked the code of HikaSerial, HikaAuction and HikaMarket. Only HikaSerial has the same issue. So we'll have to modify this for the next version of HikaSerial.

The following user(s) said Thank You: neo191987

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

Time to create page: 0.070 seconds
Powered by Kunena Forum