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.
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
Comment #1
webservant316 CreditAttribution: webservant316 commentedI 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?
Comment #2
mkalkbrennerSorry 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?
Comment #3
webservant316 CreditAttribution: webservant316 commentedMy 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 :-)
Comment #4
mkalkbrennerNow 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.
Comment #5
webservant316 CreditAttribution: webservant316 commentedOk - debug output obtained. Sending output to you in a message as it contains information about my site.
Comment #6
mkalkbrennerI 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?
Comment #7
webservant316 CreditAttribution: webservant316 commentedpage caching is already turned off.
Comment #8
mkalkbrennerWe 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.
Comment #9
webservant316 CreditAttribution: webservant316 commentedI just sent you an email.
Comment #10
mkalkbrennerThe 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
Comment #11
webservant316 CreditAttribution: webservant316 commentedWorks 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!
Comment #12
mkalkbrennerComment #13
webservant316 CreditAttribution: webservant316 commentedProblem 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?
Comment #14
webservant316 CreditAttribution: webservant316 commented#13 - probably not themekey but instead Drupal 7 mixed HTTPS session and securepages foul up.
Comment #15
mkalkbrennerYou 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.
Comment #16
webservant316 CreditAttribution: webservant316 commentedWill 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.