During the configuration of an Organic Group the following error is reported:
Notice: Undefined index: masquerade_users in masquerade_user_update() (regel 432 van /srv/www/htdocs/sites/all/modules/masquerad
# drush pmi masquerade
Project : masquerade
Type : module
Title : Masquerade
Description : This module allows permitted users to masquerade as other users.
Version : 7.x-1.0-rc1
Package : Other
Core : 7.x
Status : enabled
Path : sites/all/modules/masquerade
Schema version : 7000
Files : masquerade.install, masquerade.module
Requires : none
Comment | File | Size | Author |
---|---|---|---|
#7 | 0001-Fix-1019832-reported-by-radoeka-Fix-notice-data-loss.patch | 898 bytes | bdragon |
Comments
Comment #1
andypostCould you provide detailed steps to reproce this notice?
Comment #2
radoeka CreditAttribution: radoeka commentedSorry, I don't remember. Perhaps this report can be closed now, if the bug appears again or we know how to reproduce it the bug can be re-opened (or a new one can be opened.
Comment #3
andypostUsing 'drush version 4.2' I have no this message
Comment #5
Aeternum CreditAttribution: Aeternum commentedI have this issue too:
Notice: Undefined index: masquerade_users in masquerade_user_update() (line 443 of D:\inetpub\wwwroot\IDNCore\sites\all\modules\masquerade\masquerade.module).
I can reproduce it when logged in as user 1 (not masquerading), and either subscribing to an Organic Group or leaving an Organic Group.
Comment #6
bdragon CreditAttribution: bdragon commentedThis happens whenever something does a programmatic user_save with limited scope.
masquerade is blindly assuming that $edit['masquerade_users'] exists, which isn't the case if something is calling user_save() directly with a partial $edit array that just contains the pieces that it's changing.
Drupal 7 code is supposed to be E_ALL compliant, which includes E_NOTICE notices about undefined variables.
Both isset() and empty() can be used to check possibly undefined variables without generating a notice. A good fix is to wrap the code in
if (isset($edit['masquerade_users'])) { ... }
. Additionally, I would argue that theif ($category == 'account') {
check is unnecessary.See http://drupal.org/node/34341 for more information.
Comment #7
bdragon CreditAttribution: bdragon commentedThis also causes loss of whatever names were in the field.
isset() is TRUE for '', so it doesn't affect the ability to clear out the field.
Patch attached.
Comment #8
andypostThanx, commited http://drupalcode.org/project/masquerade.git/commit/a11dd23
Also backported to 6.x-1.x http://drupalcode.org/project/masquerade.git/commit/40cdab2
Comment #10
nathancollins44 CreditAttribution: nathancollins44 commentedI am also getting this Error upon new account creation.
Comment #11
nathancollins44 CreditAttribution: nathancollins44 commentedI am also getting this Error upon new account creation.
Notice: Undefined index: masquerade_users in masquerade_user_update() (line 443 of /home8/kpcprodu/public_html/americanwrc/sites/all/modules/masquerade/masquerade.module).
Notice: Undefined index: masquerade_users in masquerade_user_update() (line 443 of /home8/kpcprodu/public_html/americanwrc/sites/all/modules/masquerade/masquerade.module).
How do I fix this? I might need step by step instructions, I have never installed an module patch before...
Or should I just wait for the next Masquerade module update to come out and hope it fixes the bug...
Comment #12
BeaPower CreditAttribution: BeaPower commentedI also get this same error after enabling organic groups and creating a group node...
Comment #13
andypostThis already fixed RC-4 is waiting for
#1258376: Incompatible SQL statement for SQL Server
#1116034: The masquerade block is displayed regardless of permission