Deprecated: Unparenthesized after hikashop save product

  • Posts: 116
  • Thank you received: 1
4 years 4 months ago #325595

-- Joomla version -- : 3.9.22
-- PHP version -- : 7.4.9
-- Browser(s) name and version -- : Google Chrome 86.0.4240.183
-- Error-message(debug-mod must be tuned on) -- : Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /home/komp/public_html/administrator/components/com_hikashop/helpers/seo.php on line 48

Hello,

when i save my product, in hikashop backend i get a message saying:

Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /home/komp/public_html/administrator/components/com_hikashop/helpers/seo.php on line 48

What is wrong with seo.php, and how to fix this?

Here is screenshoot:

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

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
4 years 4 months ago #325612

Hi,

Thanks for your feedback. It's due to your version of PHP which is quite recent and some old code we have in the meta description auto fill function. It's not really a problem. PHP just adds that message to inform developers that they should update their code as it won't work with future versions of PHP. So that's what we'll do.

On your end, you can either ignore that message, or change the code:
$max = (($max < 1) ? 1 : ($max == 0) ? 300 : $max);

to:
if(empty($max) || $max < 1) $max = 300;

in the file /administrator/components/com_hikashop/helpers/seo.php and it will remove the message.
We'll add that change on our end too for future versions of HikaShop.

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

Time to create page: 0.055 seconds
Powered by Kunena Forum