Redirects to same path + validation error with block caching enabled
| Project: | Switchtheme |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Have Firefox open with my admin user, Safari with my 'editor' role. After I ran cron from the admin menu, switched to the other browser and clicked on a node (lets call it node/34). Used the theme switcher on this same page to switch themes. Cool, different theme, still on node/34 (correct behavior). Now, when I go to a different node, say node/99, and switch themes, i get bounced back to node/34. Seems it gets stuck on whatever node you first go to AFTER cron is run AND switch the theme. (NOT the node you're CURRENTLY on after cron--you have to refresh the page OR click on something else then switch themes, and THAT'S the page it sticks on.)
I don't think I was able to recreate this on the browser I was logged in as my admin, user1, so it seems like it might be a non-user1 thing.

#1
Unfortunately, SwitchTheme has nothing to do with cron. I'm not sure what could trigger this behavior for you, but it somehow sounds like a third-party contrib module interferes.
#2
I have some more info on this bug. It does not affect user 1, as the OP says. It only occurs when block caching is enabled. It isn't related to cron directly, but I'm guessing the block cache is getting cleared when cron is run, so it appears to reset things. Using the 'Flush all caches' item in admin_menu achieves the same reset state. The bug does not occur using the built-in per user theme switching form on the user edit page.
After clearing the cache the first page that a user switches the theme on becomes the page that is redirected to any time that user or any other user switches to that theme. It is per theme, so if you switch to theme A while on page X, it will always redirect to page X when that theme is switched to. And if you then go to page Y and switch to theme B, page Y becomes the page redirected to for theme B. If it is a different user that switches to a theme than the one that first switched to a particular theme, then the user will also receive a validation error in addition to the redirect after switching the theme.
I've tested on a plain drupal install with only core modules enabled, so it does not seem like a third-party module issue. I'm switching the priority to critical as this bug makes the module unusable with block caching enabled, which basically makes it useless for high traffic sites. I'm also updating the title to reflect the nature of the bug a little better.
#3
block cache cleared on cron run seems the more likely culprit, i agree. haven't tested yet though.