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 :

function profile_user_cancel(&$edit, $account, $method) {
function profile_user_cancel($edit, $account, $method) {

#1 1780012-1-profile-hook_user_cancel.patch513 bytesdewens
PASSED: [[SimpleTest]]: [MySQL] 39,351 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more


dewens’s picture

513 bytes
PASSED: [[SimpleTest]]: [MySQL] 39,351 pass(es). View


earnie’s picture

Status: Active » Needs review

Here testbot.

mbrett5062’s picture

I 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.

earnie’s picture

Status: Needs review » Reviewed & tested by the community

All 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.

mbrett5062’s picture

I 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.

earnie’s picture

It 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.

webchick’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

I'm with mbrett5062. What are the steps to reproduce this?

Thanks, mbrett5062 for your efforts in clearing the "needs review" queue. :D

David_Rothstein’s picture

Version: 7.15 » 7.x-dev
Status: Postponed (maintainer needs more info) » Fixed

@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 :)

mbrett5062’s picture

OK, 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!

Automatically closed -- issue fixed for 2 weeks with no activity.