Suitecrm: The sourcodes contain obsolete code

Created on 9 Nov 2016  路  8Comments  路  Source: salesagility/SuiteCRM


Issue


The following files contain incompatible code for PHP 7.0

  • /soap.php
  • /soap/SoapData.php
  • /soap/SoapHelperFunctions.php
  • /service/core/PHP5Soap.php
  • /service/core/SoapHelperWebService.php
  • /include/nusoap/nusoap.php
  • /include/nusoap/class.xmlschema.php
  • /include/nusoap/class.soap_val.php
  • /include/nusoap/class.soap_fault.php
  • /include/nusoap/class.wsdl.php
  • /include/nusoap/class.nusoap_base.php
  • /include/nusoap/class.soap_transport_http.php
  • /include/nusoap/class.soapclient.php
  • /include/nusoap/class.soap_server.php
  • /include/nusoap/class.soap_parser.php
  • /include/nusoap/class.wsdlcache.php

Our Environment

  • SuiteCRM Version 7.7.6
  • Browser name and version: Firefox ver. 49.0.2
  • Environment name and version: MySQL, PHP 7
  • Operating System and version: Ubuntu 16.04
Moderate Bug Deprecated

All 8 comments

@jobvector , can you print those files, and highlight where code is incompatible?, otherwise the question is too general and will be directed to the forum.

codesniffer results for PHP version 7.0

codesniffer_include.txt
codesniffer_service.txt
codesniffer_soap.txt

SuiteCRM on PHP 7.1 now pull out deprecation errors everywhere:
image

Yes, we have enable the deprecation error level because we must get rid of all obsolete code.

NuSoap is a PHP4 library and the original library has not been updated to support modern PHP versions. It is living with borrowed time. Suggestion, as a temporary fix, replace it with a forked version that supports PHP 7.1 from https://github.com/econea/nusoap

In the future dependencies should be replaced by native PHP SOAP. If for some reason, the required extensions are not available, then fallback to NuSoap.

We haven鈥檛 been able to replicate this issue in any newer version of SuiteCRM such as 7.10.x or 7.11.x.
This issue has been closed as version 7.8.x of SuiteCRM has reached its end of life and therefore will no longer be receiving updates.
If you feel this issue is still present in the supported versions please leave a comment explaining the steps to reproduce and we'll re-open this issue.
For more information about 7.8.x end of life please visit our blog post

@Mac-Rae thanks for taking your time to look on this issue. If you configure PHP 7.1 or 7.2 to avoid all deprecation warnings, then you will not get them. However, if the same PHP installation on the server is used for other applications and those depends on the error and warning level, then it will break something else.

I reviewed the master 7.11.x code and the reason for those warnings still there. @Dillon-Brown was working on #6750 to fix this issue, but it has not merged yet. So I feel this should not be closed as it still affects the current SuiteCRM version.

Simple test to see if your PHP configuration is masking these warnings, on a terminal or command prompt, go to your PHP installation folder and run this command:
php -r "class test{ public function test(){}}"
It should return this warning:
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; test has a deprecated constructor in Command line code on line 1
I have not tested on PHP 7.3 what will be the effect of these (ignore them or create errors?).

As a workaround, at the moment, we are masking them at the SuiteCRM config.php level.

@cherrador Agreed that this is still an issue until #6750 gets merged (I'll raise this internally to hopefully get code-reviewed and merged in). I think we should probably just keep this one closed though as we already have:

4754

1002

7065

which are all addressed by the same PR.

@Dillon-Brown Awesome, I think you are right. This one is specific to one of the libraries that is causing the problem. The other issues track a higher scope.

Relevant: #7590 / #7592

Was this page helpful?
0 / 5 - 0 ratings