Skip to content

Soap api v4_1 is not working with php 8 must be a valid callback, non-static method SugarWebServiceImplv4_1::login() #9741

Open
@rahulshinde19

Description

@rahulshinde19

Soap api v4_1 failing while calling any method
We are using SuiteCRM version 7.12.7 with PHP 8.0.13
while calling Soap api we are getting following error.

<faultstring xsi:type="xsd:string">Unknown error in SOAP call: service died unexpectedly</faultstring>
         <detail xsi:type="xsd:string"><![CDATA[<br />
<b>Fatal error</b>:  Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, non-static method SugarWebServiceImplv4_1::login() cannot be called statically in C:\xampp80\htdocs\SuiteCRM-7.12.7\include\nusoap\nusoap.php:5437
Stack trace:
#0 C:\xampp80\htdocs\SuiteCRM-7.12.7\include\nusoap\nusoap.php(5054): nusoap_server-&gt;invoke_method()
#1 C:\xampp80\htdocs\SuiteCRM-7.12.7\service\core\NusoapSoap.php(93): nusoap_server-&gt;service('&lt;soapenv:Envelo...')
#2 C:\xampp80\htdocs\SuiteCRM-7.12.7\service\core\webservice.php(70): NusoapSoap-&gt;serve()
#3 C:\xampp80\htdocs\SuiteCRM-7.12.7\service\v4_1\soap.php(56): require_once('C:\\xampp80\\htdo...')
#4 {main}
  thrown in <b>C:\xampp80\htdocs\SuiteCRM-7.12.7\include\nusoap\nusoap.php</b> on line <b>5437</b><br />]]></detail>

Expected Behavior

The login soap v4_1 API should return session token and other api should work

Actual Behavior

It is returning error for all APIs
The function call_user_func_array throwing fatal error in PHP 8 if the function is not static. In the code call_user_func_array is calling method statically but all methods are not declared as non-static

Possible Fix

In include/nusoap/nusoap.php line number 5428 the control should not go into elseif ($delim == '..') this condition. it should go to else instead.

Steps to Reproduce

Call soap api service/v4_1/soap.php with parameters

Your Environment

  • SuiteCRM Version used: 7.12.7
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)):
  • Environment name and version (e.g. MySQL, PHP 8.0.13):
  • Operating System and version (e.g RedHat 8.6):

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: APIIssues & PRs related to all things regarding the APIArea: PHP8Issues & PRs related to the CRM when using PHP8Priority:ImportantIssues & PRs that are important; broken functions, errors - there are workaroundsStatus: Team InvestigatingLabels for issues in which the Core Team are investigating / Intend to InvestigateStatus:Fix ProposedA issue that has a PR related to it that provides a possible resolutionType: BugBugs within the core SuiteCRM codebase

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions