When switch from one users node with their theme explicitly set to another users node with their theme set to the detail the theme switches for both an anonymous and registered user.

I have these themekey settings checked as on...

Retain the theme until a new theme is set
Retain the theme until a new theme is set for anonymous users

What am I doing wrong or is this a bug? I see that it has been an issue in the past but there are no posts made for themekey 7.x.

Comments

webservant316’s picture

I am using 7.x-3.0-beta1 in order to have this feature https://drupal.org/node/2082427. However, perhaps the retain theme bug was not fixed in beta1?

mkalkbrenner’s picture

... to another users node with their theme set to the detail ...

Sorry I don't understand that description exactly.
Please provide a more detailed example including Your ThemeKey Rule Chain.

BTW Why don't you update to 7.x-3.0 final?

webservant316’s picture

My website allows registered users to create their own mini-website and choose a theme for their content. However, I want people viewing their pages to occasionally view 'webmaster' pages, but still retain the theme from the registered users mini-website.

To accomplish this the mini-website registered users choose a theme explicitly for their content, however the webmaster has not set an explicit theme for his content, but instead uses the default theme.

Then on this page /admin/config/user-interface/themekey/settings
I checked these flags...
ON - Retain the theme until a new theme is set
ON - Retain the theme until a new theme is set for anonymous users

The only rule in my chain is
themekey_ui:author_triggers_theme

On this page /admin/config/user-interface/themekey/settings/ui
I checked this flag...
ON - Let the user select a theme that will be used to display all content she creates.

====

Am I configured wrong or is this a bug? Or is it not possible to do what I want? Feature request :-)

mkalkbrenner’s picture

Now I understand your issue.

Your configuration should be correct. (If you accept that this turns off page caching.)

There two possible reasons for the malfunction:
1. a bug
2. something else affects the theme decision.

Can you please turn on ThemeKey Debug and trace theme switching for anonymous users. I need it's output when an anonymous user visits a page the webmaster created. The usere should visit a user's node and than directly a webmaster's page.

webservant316’s picture

Ok - debug output obtained. Sending output to you in a message as it contains information about my site.

mkalkbrenner’s picture

I did some tests and the feature worked as expected, even for anonymous users.
In your debug output I can see that system:session is empty. That causes the issue.
What happens if you turn off page caching?

webservant316’s picture

page caching is already turned off.

mkalkbrenner’s picture

We have to figure out what kills the sessions for anonymous users in your setup. Contact me via mail to find a possibility to debug your system.

webservant316’s picture

I just sent you an email.

mkalkbrenner’s picture

Title: Retain the theme not working for anonymous or registered user » 'Retain the theme until a new theme is set' doesn't work for static/triggered rules
Version: 7.x-3.0-beta1 » 7.x-3.x-dev
Assigned: Unassigned » mkalkbrenner
Status: Active » Needs review

The problem was that the default theme instead of the selected theme has been stored in the user's session if a "static" rule matched. This commit should fix the issue:
http://drupalcode.org/project/themekey.git/commit/b0c3b50

webservant316’s picture

Works for me with some quick tests.
Theme retained for anon and auth user when retain flags 'on' in settings.
Theme not retained for anon and auth user when retain flags 'off' in settings.

Thanks!

mkalkbrenner’s picture

Status: Needs review » Fixed
webservant316’s picture

Problem observed. Occasionally when moving from admin pages to pages owned by another use my admin session gets fouled up such that the admin_menu disappears. The session is not completely lost, but I do need to log out to reset things. I think this issue may be related to the above. I cannot consistently reproduce the error yet.

Shall I re-open this issue or create another?

webservant316’s picture

#13 - probably not themekey but instead Drupal 7 mixed HTTPS session and securepages foul up.

mkalkbrenner’s picture

You should do some more tests. Switching the protocol from HTTP to HTTPS might kill the session depending on your session cookie configuration. This is not related to ThemeKey. If you think that ThemeKey is part of the issue we should open a new issue because it's not directly related to this one.

webservant316’s picture

Will do, thanks. Actually I am now thinking it is an 'admin_menu' problem. The session remains in tact, but the 'admin_menu' disappears when I switch to a new theme. I will post back to a new issue if I think themekey is the culprit.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.