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.
I installed the Organic Group module and suddenly masquerade module is not working !
The swithc back function is not working and the button is not showing up.
The switching to other users actually work, but u cant get back.
As i disabled all the OG modules, it worked again.
If og modules are installed (og module access control on or off, doesnt count) then masq. doesnt work.
Comment | File | Size | Author |
---|---|---|---|
#15 | og_fix_0.patch | 1.25 KB | Steve Dondley |
#14 | og_fix.patch | 1.25 KB | Steve Dondley |
#12 | masquerade.module_2.patch | 978 bytes | jhm |
Comments
Comment #1
mj2308 CreditAttribution: mj2308 commentedI have the same problem as well ... =(
Comment #2
smilodon CreditAttribution: smilodon commentedI gave up with OG, fortunately it was not so critical on my site. Very many problems solved, less errors with every other module.
Comment #3
ec CreditAttribution: ec commentedI also have the same problem here with drupal 4.7.0 and latest og release ! regards, eric.
Comment #4
starbow CreditAttribution: starbow commentedHmm, seems like $user->masquerade is getting unset somewhere.
It's a nasty hack, but you can work around this by changing the line:
$items[] = array('path' => 'masquerade/unswitch',
'title' => t('switch back'),
'callback' => 'masquerade_switch_back',
'access' => $user->masquerading,
'type' => MENU_NORMAL_ITEM);
to:
$masquerading = db_result(db_query("SELECT uid_from FROM {masquerade} WHERE sid = '%s'\
AND uid_as = %d", session_id(), $user->uid));
$items[] = array('path' => 'masquerade/unswitch',
'title' => t('switch back'),
'callback' => 'masquerade_switch_back',
'access' => $masquerading,
'type' => MENU_NORMAL_ITEM);
Comment #5
yngens CreditAttribution: yngens commentedHi,
I also have this problem. Tried given replacement of the code, but unfortunately it did not help, I still can not change back to admin. Any progress on this issue?
Comment #6
cooperaj CreditAttribution: cooperaj commentedI am encountering the same issue.
and the above code does not fix.
Regards
Adam
Comment #7
cooperaj CreditAttribution: cooperaj commentedFound that the menu cache was not being cleared for the new user when switching. Meaning that although starbows fix was working the menu displayed was a cached version, hence no switch back option. To fix
Add:
Just above:
In:
Making:
Comment #8
ec CreditAttribution: ec commentedHy, I tried both fix but still fall on the same issue ! Any idea ? regards, eric.
Comment #9
jhm CreditAttribution: jhm commentedit doesn't work with OG because that module calls the user_load function and thus overrides the state of masquerading the masquerade module is trying to track in the global $user structure.
I am looking into a patch for the masquerade module, so it will not use a global structure that could be overritten to track its state.
see: http://drupal.org/node/71907
Comment #10
jhm CreditAttribution: jhm commentedI created a new global variable called masquerading and set its value to
null
. In theinit
hook of masquerade I track the masqueraded uid in this global variable.This being a quick hack, I did not bother removing/changing the current global $user references.
This is what the new masquerade_init looks like:
Now we just need to modify the
menu
hook to retrieve the global value:that works on my 4.7.2 drupal installation with the latest og module.
Comment #11
merlinofchaos CreditAttribution: merlinofchaos commentedCan you submit this in patch form?
Comment #12
jhm CreditAttribution: jhm commentedhere is a patch file
Comment #13
Steve Dondley CreditAttribution: Steve Dondley commentedI tried the patch but it doesn't to seem to have any affect at all.
Comment #14
Steve Dondley CreditAttribution: Steve Dondley commentedOK, here's a different version of jhm's patch. The switch back link now shows for me. I did away with using $user->masquerade and just used the $GLOBALS['masquerade'] variable. Maybe this isn't the best way but it works.
Comment #15
Steve Dondley CreditAttribution: Steve Dondley commentedHmm...somehow some tabs snuck into the patch. Here's a version of the same patch with them removed.
Comment #16
Steve Dondley CreditAttribution: Steve Dondley commentedSet to review.
Comment #17
Steve Dondley CreditAttribution: Steve Dondley commentedPatch applied, committed to head and drupal-4-7 branch
Comment #18
(not verified) CreditAttribution: commented