Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The current version of update.compare.inc/_update_process_info_list()
takes &$list
as second parameter, but the code never modifies the value of $list, so this can be removed.
In addition, this causes an error under E_ALL | E_STRICT, because update_get_projects
passes the result of two function calls as the values for this parameter, and function returns cannot be passed by reference, so it is necessary to either use a temporary variable or remove the reference in _update_process_info_list()
.
The suggested patch removes the reference.
Comment | File | Size | Author |
---|---|---|---|
#2 | update.compare.patch | 719 bytes | fgm |
update.compare.patch | 674 bytes | fgm | |
Comments
Comment #1
cburschkaNote for other testers: This patch is not made from drupal root, but from modules/update. fgm, please diff from the root directory in the future, it makes things a lot more convenient. :)
Patch applies and causes no errors.
However, I'm curious about this:
I wasn't able to trigger a notice by making the unpatched module check for updates... when should this happen?
Comment #2
fgmWithout the patch, and using PHP 5.2.3-1, just going to admin/settings causes the two warnings:
strict warning: Only variables should be passed by reference in /usr/local/src/drupal/60/modules/update/update.compare.inc on line 26.
strict warning: Only variables should be passed by reference in /usr/local/src/drupal/60/modules/update/update.compare.inc on line 27.
Here is the patch rerolled from site root
Comment #3
cburschkaI'm beginning to think the problem might be on my end.
In fact, there will be no error output on my site from the above code. So I guess my test results should be ignored.
In any case, the patch has no side effects, it still applies cleanly, solves a redundancy and will bring the code toward E_STRICT compliance. So I'm going to go ahead and mark this ready.
Comment #4
Gábor HojtsyCommitted.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.