Error on Add to cart

  • Posts: 120
  • Thank you received: 14
  • Hikashop Business
1 month 3 weeks ago #363546

-- HikaShop version -- : 5.1.1 [2409180854]
-- Joomla version -- : 4.4.8
-- PHP version -- : 8.2.23
-- Error-message(debug-mod must be tuned on) -- : Deprecated: Use of "self" in callables is deprecated in /libraries/vendor/phpseclib/bcmath_compat/src/BCMath.php on line 492

Adding any item to the cart throws 25 identical errors in the cart module as follows

Deprecated: Use of "self" in callables is deprecated in /libraries/vendor/phpseclib/bcmath_compat/src/BCMath.php on line 492


Updating everything before chasing other issues discussed here and this popped up

Last edit: 1 month 2 weeks ago by yerg55. Reason: Resolved

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 month 3 weeks ago #363553

Hi,

HikaShop uses the PHP function called bccomp in some areas when comparing floating numbers for greater precision / control.
It seems that the bcmath compat was added to Joomla for servers where bcmath is not available in PHP.
And the deprecated message there comes from that bcmath compat library.
This comes from changes made in PHP 8.2 :
exakat.readthedocs.io/en/latest/Referenc...#deprecated-callable
I found one instance on the web with someone else simply turning off the error reporting to avoid the message from popping up:
github.com/SondagesPro/pdfReport/commit/...5d6a5cd0fbee3387R821
Now, from what I can see on the official github of the bcmath_compat library, this deprecated message has already been dealt with:
github.com/phpseclib/bcmath_compat/blob/master/src/BCMath.php
Similarly, you can change the line:
return call_user_func_array('self::' . $name, $arguments);
to:
return call_user_func_array(self::class . "::$name", $arguments);
and it will remove that deprecated message.
In the long term, Joomla will update the bcmath_compat library and it will remove the deprecated message.

You could also turn off the "error reporting" in the Joomla configuration. That should actually be the case on any live website for security reasons.

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

  • Posts: 120
  • Thank you received: 14
  • Hikashop Business
1 month 3 weeks ago #363555

As I mentioned elsewhere is that this error is prohibiting transfer to Square for payment and return

I turned on debug to find out why and that was my discovery.

Been in contact with credentials to ascertain what the issue is.

Await the discovery
Thanks

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 month 3 weeks ago #363557

Hi,

No. This is not an error. It's a deprecated message. It tells the developer that they need to adapt the code for futur versions of PHP.
It doesn't change the behavior of the system. So your issue with Square is not linked to this. That's why I brushed it off in the other thread ( www.hikashop.com/forum/payment-methods/9...stration-issues.html ).

I specifically researched the deprecated message here as you posted it as a separate message. I also provided the solution in my previous message here. If you apply the change, you'll see that the deprecated message doesn't appear anymore. And you'll see that you'll still have the same issue with Square as the two are not linked.

So I think we can close this subject here and focus on the real problem you have on the other thread.

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

Time to create page: 0.056 seconds
Powered by Kunena Forum