When using ThemeKey for any given page, the Ajax POST to ?q=autologout_ahah_logout returns a settings command which contains incorrect ajaxPageState data. This is fine until you are using a module which makes use of AHAH requests to update the page content. Replication steps as follows:
- Visit a page where ThemeKey provides the non-default theme
- Complete an action that requests HTML via Ajax, e.g. via Ajax Facets
- In the browser's developer console, type: Drupal.settings.ajaxPageState.theme. Notice it returns the default theme, not the current theme of the page.
- Complete another action that requests HTML via Ajax
- Observe a mixture of the page theme and the default theme
This is happening because ThemeKey rules for the page are not being processed due to the path of the request. There are multiple closed issues for ThemeKey relating to this, but they are all closed. I am running latest Dev version of ThemeKey: https://www.drupal.org/project/themekey/releases/7.x-3.x-dev.
A simple solution could be to ensure that form data for ajax_page_state from the current page is posted during the autologout ajax request, this ensures that ajax_base_page_theme() receives the current theme data and returns the correct ajaxPageState in the command provided in the response.
Comment | File | Size | Author |
---|---|---|---|
#9 | autologout-ajax-theme-2769219-9.patch | 978 bytes | RoSk0 |
#2 | themekey-ajax-2769219-#1.patch | 978 bytes | nijk |
Comments
Comment #2
nijk CreditAttribution: nijk commentedComment #3
nijk CreditAttribution: nijk commentedComment #4
RoSk0Code looks good and actually fixes the issue with theme detection even without themekey.
Comment #9
RoSk0Same file, but renamed for bots.
Comment #10
nijk CreditAttribution: nijk commentedThanks RoSkO,
I have no idea why I put the # symbol in the patch name, sorry for that headache!
Comment #12
AjitSThank you for reporting, the patch and the reviews! This is on RTBC for a long time. Committed and pushed to 7.x-4.x. Commit given to the original author of the patch.