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 had some quick switch users in the settings then deleted them. Instead of an array, the variable 'masquerade_quick_switches' became '' and this caused an error in the foreeach at masquerade_block_1().
My fix is
Index: modules/masquerade/masquerade.module
===================================================================
--- modules/masquerade/masquerade.module (revision 19104)
+++ modules/masquerade/masquerade.module (working copy)
@@ -441,6 +441,7 @@
// Add in user-specific switches.
$result = db_query("SELECT uid_to FROM {masquerade_users} WHERE uid_from = %d", $user->uid);
+ $masquerade_switches = array();
while ($uid_to = db_result($result)) {
$masquerade_switches[] = $uid_to;
}
Comment | File | Size | Author |
---|---|---|---|
#3 | 852270-masquerade-settings-d6.patch | 2.51 KB | andypost |
#2 | 852270-masquerade-settings-d6.patch | 2.81 KB | andypost |
Comments
Comment #1
jonathan_hunt CreditAttribution: jonathan_hunt commentedDoh, that was bogus. Try
Comment #2
andypostThis is a critical because functionality broken.
Confirm this bug! This caused by running system_settings_form_submit() and saving wrong values before module submit function
Also fixed:
- menu rebuild called only if "menu quick switch" changed
- no reason to clear cache for blocks once system_settings_form_submit() clears both page and block cache
if we wanna to clear only cache_block so form need unset
system_settings_form_submit
handler and save all variables itselfComment #3
andypostvalues for 'masquerade_quick_switches' variable are prepared in _masquerade_admin_settings_validate() so system_settings_form_submit() now save valid values
masquerade_admin_settings_submit() now rebuilds menu if needed
Comment #4
afreeman CreditAttribution: afreeman commentedLooks good, tests correctly in my environment.
Comment #5
deekayen CreditAttribution: deekayen commentedCommitted to DRUPAL-6 branch.
Comment #6
andypostFixed after #1006668: General code cleanup and wish to make D7rc1 release