I think we should update the deprecated constructors. Though this deprecation was recently introduced it seems like an easy update. Managed to list 4 of them using a compatibility checker.
File: /home/lz/sites/moneysuite/ms_core/gateways/ms_paypal_wps/includes/ms_paypal_wps_class.php
Line 14: PHP 4 constructors are now deprecated
function ms_paypal_wps_class($ipn_vars = NULL)
{
}
File: /home/lz/sites/moneysuite/ms_core/gateways/ms_ibis/Merchant.php
Line 51: PHP 4 constructors are now deprecated
function Merchant($url, $keystore, $keystorepassword, $verbose = 0)
{
}
File: /home/lz/sites/moneysuite/ms_core/gateways/ms_realex/ms_realex.class.php
Line 19: PHP 4 constructors are now deprecated
function RealexRemote($url, $xml)
{
}
File: /home/lz/sites/moneysuite/ms_affiliates/includes/ms_paypal_wps_class.php
Line 18: PHP 4 constructors are now deprecated
function ms_paypal_wps_class($ipn_vars = NULL)
{
}
Draft:
function __construct($ipn_vars = NULL) {
$this->ipnLink = (isset($ipn_vars['test_ipn']) AND $ipn_vars['test_ipn']) ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr';
$this->ipn_vars = $ipn_vars;
$this->lastError = '';
$this->ipnResult = '';
}
function ms_paypal_wps_class($ipn_vars = NULL) {
self::__construct();
}
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | update_deprecated_constructors-2811265-5.patch | 2.54 KB | vaccinemedia |
Comments
Comment #2
Farreres commentedHeh, no idea what you mean. Maybe some other one can help with this...
Comment #3
clivem commentedunderstand the changes you are suggesting, need to check that the changes would work ok with php 7
Comment #4
vaccinemedia commentedAny update on this? We have just upgraded php to 7 and getting the following notice:
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ms_paypal_wps_class has a deprecated constructor in /path/to/site/sites/all/modules/contrib/moneysuite/ms_core/gateways/ms_paypal_wps/includes/ms_paypal_wps_class.php on line 8
Comment #5
vaccinemedia commentedHere's a patch updating the 4 offending classes above.
Comment #6
vaccinemedia commentedComment #7
clivem commentedHi vaccinemedia, updated the dev version with your patch. please test in your system and let us know of any issues.
Comment #8
vaccinemedia commented@Clivem I've noticed some of my patches have been committed into the new version but have not been attributed to myself so I do not get credit for these. Also these issues which are not in the new version of the module have not been closed. In future, these issues need to have proper accreditation and if they o into a future stable release then they also need to be closed also on Drupal.org.
Comment #9
Farreres commentedVaccine, I'll take some time during the next days to upload pending patches into dev. I can't test them though, but as they are going to be loaded into dev, if they cause any problem we can remove them.