salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.5k stars 2.09k forks source link

Nusoap Constructor error messages #7065

Open jobst opened 5 years ago

jobst commented 5 years ago

Related: #1002, #4754, #6750

Issue

PHP will disallow in one of the next versions to have constructors named with the same name as the class instead of __constructor.

Expected Behavior

No error messages in NUSOAP due to constructors

Actual Behavior

Lots of error messages in NUSOAP due to constructors

[18-Mar-2019 13:22:32 Australia/Melbourne] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; nusoap_base has a deprecated constructor in PATH_TO_SUITECRM/include/nusoap/nusoap.php on line 323 [18-Mar-2019 13:22:32 Australia/Melbourne] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; nusoap_fault has a deprecated constructor in PATH_TO_SUITECRM/include/nusoap/nusoap.php on line 1476 [18-Mar-2019 13:22:32 Australia/Melbourne] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; nusoap_xmlschema has a deprecated constructor in PATH_TO_SUITECRM/include/nusoap/nusoap.php on line 1769 [18-Mar-2019 13:22:32 Australia/Melbourne] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; soapval has a deprecated constructor in PATH_TO_SUITECRM/include/nusoap/nusoap.php on line 2965 [18-Mar-2019 13:22:32 Australia/Melbourne] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; soap_transport_http has a deprecated constructor in PATH_TO_SUITECRM/include/nusoap/nusoap.php on line 3272 [18-Mar-2019 13:22:32 Australia/Melbourne] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; nusoap_server has a deprecated constructor in PATH_TO_SUITECRM/include/nusoap/nusoap.php on line 4807 [18-Mar-2019 13:22:32 Australia/Melbourne] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; wsdl has a deprecated constructor in PATH_TO_SUITECRM/include/nusoap/nusoap.php on line 6163 [18-Mar-2019 13:22:32 Australia/Melbourne] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; nusoap_parser has a deprecated constructor in PATH_TO_SUITECRM/include/nusoap/nusoap.php on line 8313 [18-Mar-2019 13:22:32 Australia/Melbourne] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; nusoap_client has a deprecated constructor in PATH_TO_SUITECRM/include/nusoap/nusoap.php on line 9177

Possible Fix

replace all constructors with the same name as the class with __constructor

Steps to Reproduce

1.access SuiteCRM by kind of external calendar 2.look at logs 3.lots of error messages

Context

LOW it slows the system down due to error messages and incorrect contructors

Your Environment

Dillon-Brown commented 5 years ago

This should now be fixed with #6750.

jobst commented 5 years ago

Hi @Dillon-Brown

This is just for reference purposes and might help other people.

Been moving a large bunch of CentOS6.X to 7.X ... really tricky move depending on the complexity of the server (one has taken me a couple of weeks), this too involved upgrading Apache from 2.2 to 2.4 requiring many, many changes)

I had issues with calendars (SuiteCRM based) not updating properly on mobiles and I thought this was Apache 2.4 and systemD related ... SystemD eats up too many of the error messages!

It turns out it was nusoap, due to PHP7.X now THROWING errors because of "the same named as class constructors" .... of course the receiving app on the phone couldn't understand the "throwing error garbage" ;-)

I only figured it out using another external linux server (not work related) that I have. Using CURL and some of the URL the SuiteCRM Apache server reported in logs I finally figured it out by using curl and said URL's ....

The problem is I cannot turn everything off in PHP.INI as I would not be able to see every problem and debug the system.

I guess it may be advisable to mark these kind of errors "medium" and up instead of low as they can create some havoc.

Dillon-Brown commented 5 years ago

Hi @jobst, I definitely see where you're coming from. The only thing that would hold me back from marking PHP notices as a higher priority is that we just have so many of them that for a typical user the only real solution is to turn them off in php.ini.

I definitely want to focus on fixing as many as possible + cleaning up the massive amounts of unnecessary warnings in the suitecrm.log. If you do spot any frequent PHP errors that you want to see fixed please keep raising on GitHub and I'll generally put up a fix fairly fast since they're usually pretty simple to resolve. Thanks!

AnggaChelsea commented 4 years ago

How I Can implementations Nusoap_base for search bar php?

jobst commented 3 years ago

@Dillon-Brown

SuiteCRM Version 7.11.18

Please find attached the nusoap.php file in the directory /SUITECRMDIR/include/nusoap

It has ALL php errors fixed. Just replace.

I had to add "txt" otherwise would let me upload.

nusoap.php.txt