Note: Module tests as working so far.
There is one warning in a test which is not critical.
The ldap_servers.functions.inc has a possible ERROR, in case anyone has encountered it.
ldap/ldap_servers/ldap_servers.functions.inc
--------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------
18 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
18 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
18 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
429 | ERROR | preg_replace() - /e modifier is deprecated since PHP 5.5 and removed since PHP 7.0
--------------------------------------------------------------------------------------------------
For the above inside
function ldap_user_modify($dn, $attributes, $ldap_server) {
Line 18:
$tokens = ['%dn' => $dn, '%sid' => $this->sid, '%ldap_errno' => ldap_errno($this->connection), '%ldap_err2str' => ldap_err2str(ldap_errno($this->connection))];
however also says:
* This has been depracated(sic) in favor or $ldap_server->modifyLdapEntry($dn, $attributes)
* which handles empty attributes better.
And the warning in the test
ldap/ldap_test/LdapTestCase.class.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
141 | WARNING | Since PHP 7.0, functions inspecting arguments, like debug_backtrace(), no longer report the original value as
| | passed to a parameter, but will instead provide the current value. The parameter "$description" was used, and
| | possibly changed (by reference), on line 131.
------------------------------------------------------------------------------------------------------------------------------------
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | ldap-php71-errors-3073824-9.patch | 1.88 KB | solideogloria |
| #8 | ldap-php71-errors-3073824-8.patch | 1.36 KB | solideogloria |
| #4 | ldap_php71_errors-3073824-4.patch | 971 bytes | darrell_ulm |
Comments
Comment #2
darrell_ulm commentedComment #3
grahlPatches are welcome
Comment #4
darrell_ulm commentedHere is a patch for the first part, which is a similar to how the watchdog message was setup in a previous version of the function.
The warnings for warning in the test file appear to be a false positive.
Comment #5
darrell_ulm commentedComment #6
grahlWhile I like that the arguments are collated with the request, I'd prefer if we just switch out
$this->connectionwith the available information in$ldap_server->connectionand remvoe the other$thisvariable.I'm fine with adding the values but would appreciate if the error would get added back in.
P.S.: An "Error: " prefix is not a common usage in other modules when the message is already marked as a watchdog error.
Comment #7
darrell_ulm commentedGood points, thanks! I'll re-roll this =when= time permits.
Comment #8
solideogloria commentedI made changes according to #6. I also updated the comment to show it is @deprecated.
I did think about this, maybe you could just change the function contents to
return $ldap_server->modifyLdapEntry($dn, $attributes);instead?Note that I didn't test this code.
Comment #9
solideogloria commentedI removed the code causing the error
429 | ERROR | preg_replace(). The PHP version check and /e flag are no longer needed. The module info file specifiesphp = 5.4, so anyone using anything lower will probably already have issues.Comment #11
grahlThanks for the updated patch, committed.
Even though we might be able to simplify as comment #8 indicates, ldap-7.x is EOL so we'll only add fixes for critical bugs or upgrade regressions.