useing Suite/Sugar-Version:SuiteCRM 7.14.3, Sugar Version 6.5.25 (Build 344)
searching for entrys from the addin leads to an error
Error: Unknown error in SOAP call: service died unexpectedly
on serverside the logged line is:
[Fri Mar 22 10:54:05.585930 2024] [proxy_fcgi:error] [pid 671338:tid 139976004040384] [client 83.150.2.35:62659] AH01071: Got error 'PHP message: PHP Warning: Array to string conversion in /var/www/crm/include/nusoap/nusoap.php on line 8930; PHP message: PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, non-static method SugarWebServiceImplv2_1::get_entry_list() cannot be called statically in /var/www/crm/include/nusoap/nusoap.php:5437\nStack trace:\n#0 /var/www/crm/include/nusoap/nusoap.php(5054): nusoap_server->invoke_method()\n#1 /var/www/crm/service/core/NusoapSoap.php(94): nusoap_server->service()\n#2 /var/www/crm/service/core/webservice.php(70): NusoapSoap->serve()\n#3 /var/www/crm/service/v2_1/soap.php(56): require_once('...')\n#4 {main}\n thrown in /var/www/crm/include/nusoap/nusoap.php on line 5437'
PHP 8 introduced breaking change to call_user_func_array()
• call_user_func_array() 1 array keys will now be interpreted as parameter names, instead of being silently ignored.
I’d be happy to do a PR, I think it needs some expert discussion though. I had some help from ChatGPT to fix this for me and it’s a little advanced for my PHP skills. It totally fixes my problem, but not 100% it’s the right fix.
My use case was Mautic integration with SutieCRM and this code change avoided the PHP error and solved the problem for me, other users have reported back it solves it for them.
I’d love your input! If you think for sure this needs to be changed in the core, I’ll do the PR.
Looks like your solution bypasses the new named parameters way, and just calls the function while expecting the parameter order to match, as is done in PHP 7 and below.
As long as it works!
At the bare minimum, there should be a warning in the release notes stating that API callers who use mismatched variable names must rename these variables exactly the same as in the called function, when running on PHP 8.0 and newer.