Three problems related to this, not sure if you'd rather I open separate issues:

If the system module permissions of select different theme is not set, the following problems occur:

#1. A non-admin user gets "Validation Error" messages (sometimes, but not always. may depend on the theme)

#2. Upon switching the theme, whatever page you're currently on redirects to the users/username page.

The fix is to make sure 'select different theme' is checked in system.module permissions for every role you select for 'switch theme' permissions, then you get the expected behavior for both #1 and #2.

#3. Third problem, as I see it, is that there shouldn't even be a separate permission, referring to 'switch theme', set by the switchtheme.module. User's ability to change their theme should be directly dependent upon the setting in system module (which to me seems would solve first two issues).

Comments

aterchin’s picture

Ok, my assumptions and fix for #2 is incorrect, so I opened a new issue for #2: Redirects to same path after Cron run

EDIT: Validation errors still persist..

aterchin’s picture

Priority: Normal » Minor
gilgabar’s picture

Version: 6.x-1.0 » 6.x-1.1
Priority: Minor » Normal

I think I have some more info regarding the validation errors / redirects and how to reproduce them. It does not appear to affect user 1 from what I have seen. It's easiest to test with three separate browsers and two normal users with the ability to switch themes, in addition to user 1. Log a user in to each browser. With user 1 make sure block caching is enabled. Flush the caches. Switch to one of the normal users. Switch themes for that user. Switch to the other user. Switch themes for that user. For each theme that you switched to with the first user you should get a validation error for the second user. Additionally you should be redirected to the page on which the first user first switched to that theme. If you disable block caching the behavior and errors go away.

I tried adding a BLOCK_NO_CACHE to the switchtheme block, but that did not have any effect. I'd rather not disable block caching to get this working correctly. Anyone have any additional insights into how to fix this?

sun’s picture

Status: Active » Closed (duplicate)