I noticed that when submitting a contextual filter for a view via ajax, I was getting a fatal error saying that the function themekey_check_theme_enabled was not defined.

After inspecting the themekey.module file, the first condition of themekey_is_active is:

in_array('system', variable_get('themekey_compat_modules_enabled', array()))

My install never set the themekey_compat_modules_enabled to a value, so this always returned false, disabling the inclusion of themekey_base.inc:

require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'themekey') . '/themekey_base.inc';

which contains the themekey_check_theme_enabled function.

Can this value be set on install?

CommentFileSizeAuthor
#5 2265813.patch5.55 KBmkalkbrenner

Comments

nbennett25’s picture

Issue summary: View changes
nbennett25’s picture

Note that manually setting the themekey_check_theme_enabled to array('system') breaks the node edit layout.

mkalkbrenner’s picture

Title: 'system' value never set for themekey_compat_modules_enabled variable » fatal error when submitting a contextual filter for a view via ajax
Component: Installation / Configuration » Code / API

You need to read the complete expression:
(in_array('system', variable_get('themekey_compat_modules_enabled', array())) || !(variable_get('admin_theme', '0') && path_is_admin($_GET['q'])))

It's absolutely OK and themekey_compat_modules_enabled has to be an empty array unless you install ThemeKey Compatibility module.

Please post the exact fatal error incl. line number and file and I will have a look.

nbennett25’s picture

Here is the full ajax response:

Fatal error: Call to undefined function themekey_check_theme_enabled() in /[path]/sites/all/modules/contrib/themekey/themekey.module on line 446

Thanks for any help -

mkalkbrenner’s picture

Assigned: Unassigned » mkalkbrenner
Status: Active » Needs review
StatusFileSize
new5.55 KB

Can you verify the attached patch?

mkalkbrenner’s picture

I assume that you selected the "Bypass a request forgery protection in theme selection for Ajax responses." option, right?

  • Commit 60a1ac6 on 7.x-3.x by mkalkbrenner:
    [#2265813] mkalkbrenner: fatal error when submitting a contextual filter...
nbennett25’s picture

Yes - Bypass request forgery protection was enabled.

Confirmed - patch works for me - thanks!

mkalkbrenner’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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