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:

  1. Visit a page where ThemeKey provides the non-default theme
  2. Complete an action that requests HTML via Ajax, e.g. via Ajax Facets
  3. In the browser's developer console, type: Drupal.settings.ajaxPageState.theme. Notice it returns the default theme, not the current theme of the page.
  4. Complete another action that requests HTML via Ajax
  5. 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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nijk created an issue. See original summary.

nijk’s picture

Issue summary: View changes
RoSk0’s picture

Status: Active » Reviewed & tested by the community

Code looks good and actually fixes the issue with theme detection even without themekey.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: themekey-ajax-2769219-#1.patch, failed testing.

The last submitted patch, 2: themekey-ajax-2769219-#1.patch, failed testing.

The last submitted patch, 2: themekey-ajax-2769219-#1.patch, failed testing.

The last submitted patch, 2: themekey-ajax-2769219-#1.patch, failed testing.

RoSk0’s picture

Same file, but renamed for bots.

nijk’s picture

Thanks RoSkO,

I have no idea why I put the # symbol in the patch name, sorry for that headache!

  • AjitS committed 39c86f9 on 7.x-4.x authored by nijk
    Issue #2769219 by nijk, RoSk0: Autologout doesn't play nicely with...
AjitS’s picture

Status: Reviewed & tested by the community » Fixed

Thank 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.

Status: Fixed » Closed (fixed)

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