Hey everyone,

When creating a new user at admin/people/create (with the Masquerade module enabled), I'm getting the following error message upon creation of the new user:

Warning: Missing argument 3 for masquerade_user_profile_form_submit(), called in /home/sandboxes/sandbox10/public_html/includes/form.inc on line 1063 and defined in masquerade_user_profile_form_submit() (line 366 of /home/sandboxes/sandbox10/public_html/sites/all/modules/contrib/masquerade/masquerade.module).
Notice: Undefined variable: form_state in masquerade_user_profile_form_submit() (line 368 of /home/sandboxes/sandbox10/public_html/sites/all/modules/contrib/masquerade/masquerade.module).
Notice: Trying to get property of non-object in masquerade_user_profile_form_submit() (line 369 of /home/sandboxes/sandbox10/public_html/sites/all/modules/contrib/masquerade/masquerade.module).
Recoverable fatal error: Argument 2 passed to db_query() must be an array, null given, called in /home/sandboxes/sandbox10/public_html/sites/all/modules/contrib/masquerade/masquerade.module on line 369 and defined in db_query() (line 2226 of /home/sandboxes/sandbox10/public_html/includes/database/database.inc).

I've confirmed that this error message only occurs if the Masquerade module is enabled. However, despite the error message, the user is being successfully created.

I'm guessing this has something to do with the "Masquerade settings" at the bottom of the user add page (in which the site admin is able to enter users that this user can masquerade as).

Any ideas on how to fix?

Thanks,
Ben

Comments

BenK’s picture

I also received the following error message when trying to edit a user on the user's edit page:

Warning: Missing argument 3 for masquerade_user_profile_form_submit(), called in /home/sandboxes/sandbox10/public_html/includes/form.inc on line 1063 and defined in masquerade_user_profile_form_submit() (line 366 of /home/sandboxes/sandbox10/public_html/sites/all/modules/contrib/masquerade/masquerade.module).
Notice: Undefined variable: form_state in masquerade_user_profile_form_submit() (line 368 of /home/sandboxes/sandbox10/public_html/sites/all/modules/contrib/masquerade/masquerade.module).
Notice: Trying to get property of non-object in masquerade_user_profile_form_submit() (line 369 of /home/sandboxes/sandbox10/public_html/sites/all/modules/contrib/masquerade/masquerade.module).
Recoverable fatal error: Argument 2 passed to db_query() must be an array, null given, called in /home/sandboxes/sandbox10/public_html/sites/all/modules/contrib/masquerade/masquerade.module on line 369 and defined in db_query() (line 2226 of /home/sandboxes/sandbox10/public_html/includes/database/database.inc).

Note that "Masquerade settings" also appear on the user edit page.

--Ben

deekayen’s picture

I looked at the code and compared it to the latest in api.drupal.org and on the 6-7 upgrade docs, but didn't see anything obvious. I suspect it's not so much something wrong with the function parameters as it might be just re-thinking masquerade_form_alter() and how it fits with the new profile functionality.

andypost’s picture

I made a patch to fix all D7 porting issues #1006668: General code cleanup and wish to make D7rc1 release

Let's rollup RC1 release and get more feedback from community

deekayen’s picture

Status: Active » Closed (duplicate)