I'm creating 2 new sites with Drupal 7.14. My goal was to set up User Profile Theme switching. I installed ThemeKey, checked the "Add theme option to user profile" box. When I save, I get the error:

Notice: Undefined index: enabled in themekey_rule_set() (line 374 of /homepages/24/d416583725/htdocs/jim/sites/all/modules/themekey/themekey_build.inc).

Problem is occuring on both sites. Doesn't seem to be affecting anything. Any ideas what I did wrong, or is this a bug?

Comments

mkalkbrenner’s picture

Might be that you discovered a small bug. I need some additional information to reproduce it. You had an empty rule chain, right?
- Fresh installation of Drupal 7.14 and ThemeKey 2.2 with ThemeKey UI and ThemeKey User Profile.
- Configured nothing else than "Add theme option to user profile".

Did you configure themes to be selectable in the user profile?

wdtj’s picture

I had not set up any rules, and I had not yet configured any themes to be selectable yet. I now have a theme selected but don't see the error anymore. You might be onto something.

wdtj’s picture

OK, I have a third site set up with themekey now. I have set it up with just the default Rule Chains, and set the UI for just "Add theme option to user profile". I added 4 of our themes and am still getting the error when saving the configuration.

Any thing you want me to look at? The site is test.tripolimn.org.

mkalkbrenner’s picture

Priority: Normal » Minor
Status: Active » Fixed

fixed and committed to git.

Until the next release of ThemeKey you can safely ignore this error message, because the rule gets stored with the correct default value for parent.

lalit774’s picture

i got same error.

Notice: Undefined index: parent in themekey_rule_set() (line 380 of sites/all/modules/contrib/themekey/themekey_build.inc).

here is fix

File themekey_build.inc
LINE NO 380

<?php
       ->condition('parent', $item['parent'])
?>

Replace with following

<?php
       ->condition('theme', $item['theme'])
?>
mkalkbrenner’s picture

Do not apply the fix above!

Otherwise you'll have a real bug that might destroy your rule chain instead of a harmless notice!

The correct fix has been committed to git already:
http://drupalcode.org/project/themekey.git/blobdiff/d631c5a4aa7b1f20b216...

Status: Fixed » Closed (fixed)

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