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.
When user is deleter, there is a warning
Warning: Parameter 1 to profile_user_cancel() expected to be a reference, value given in module_invoke_all() (line 850 of /[path]/[to]/public_html/includes/module.inc).
In profile.module file :
line 232 :
wrong:
function profile_user_cancel(&$edit, $account, $method) {
correct:
function profile_user_cancel($edit, $account, $method) {
Comment | File | Size | Author |
---|---|---|---|
#1 | 1780012-1-profile-hook_user_cancel.patch | 513 bytes | dewens |
Comments
Comment #1
dewens CreditAttribution: dewens commentedpatch
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedHere testbot.
Comment #3
mbrett5062 CreditAttribution: mbrett5062 commentedI have tried reviewing this patch, as far as I can see you are correct.
My only problem, is that I am unable to verify the original bug.
I downloaded and created a clean install of 7.15.
Added a new user, then cancelled the user account, and no error's warnings, or anything.
Then added second new user, and created content as that user. Then cancelled that account with setting as follows.
'Delete the account and make its content belong to the Anonymous user. '
Again, no errors or warnings.
Could you provide more specific details of the situation/settings that you receive this warning on, to help me replicate original.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedAll the proof you need that this is the correct patch is at api.drupal.org. The documentation states that the $edit is not a call by reference.
Comment #5
mbrett5062 CreditAttribution: mbrett5062 commentedI know, that was the first line in my comment, it is obviously correct. All other calls to the hook also do not call by reference.
However, as I said, I can not replicate the bug. Before fixing something, should we not be sure it is broken?
I am new to this, and was hoping to contribute something. Not ready to submit my own patches, but thought, helping to clear the 'needs review' pile would be of some help.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedIt is broken. The results are dependent on your PHP version; i.e. PHP fixed a bug that allowed it to work when it should not have.
Comment #7
webchickI'm with mbrett5062. What are the steps to reproduce this?
Thanks, mbrett5062 for your efforts in clearing the "needs review" queue. :D
Comment #8
David_Rothstein CreditAttribution: David_Rothstein commented@mbrett5062, to reproduce you need to turn on the Profile module (which can't be done via the user interface since the module is deprecated in Drupal 7). It's easy to reproduce then, on PHP 5.3 at any rate.
And since the module is gone in Drupal 8, we don't need to fix this there first, so... Committed to 7.x - thanks! http://drupalcode.org/project/drupal.git/commit/506d8c4
(semi-crosspost, but I was right about to commit this at the same time :)
Comment #9
mbrett5062 CreditAttribution: mbrett5062 commentedOK, have enabled profile module, and retested. My PHP version is 5.4.4, maybe that is the reason I still can not replicate a bug.
But, that said, I see no reason not to correct an obvious error in the code, provided it does not effect anything else!