Reviewed & tested by the community
Project:
ThemeKey
Version:
7.x-3.x-dev
Component:
Code / API
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Nov 2014 at 16:58 UTC
Updated:
17 Apr 2021 at 17:37 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mkalkbrennerWhich version of ThemeKey are you using? Please post the content of line 38 here.
In current dev I don't see how an "Undefined index" error could be triggered:
Comment #2
pachabhaiya commentedIn themekey/themekey_cron.inc file (line 34), the value of `$item->property` is sometimes empty. And when this `$item->property` is empty then it throws the watchdog notice as mentioned in this issue.
Attached patch to fix this issue.
Comment #3
pachabhaiya commentedComment #4
pachabhaiya commentedHi mkalkbrenner,
Sorry, it's line 34 instead of 38. I've corrected the issue title.
Comment #5
pachabhaiya commentedAttached patch to fix this issue.
Comment #6
mkalkbrennerYour patch is not correct. It simply hides an error.
The function themekey_rebuild() creates this array. And it should not happen, that $item->property doesn't exist as array key.
Unfortunately I was not able tor reproduce this issue. Therfor some debugging on your side will be required to find the real issue. Can you do a var_dump($item) when $item->property doesn't exist?
Comment #7
pachabhaiya commentedWhen I run this SQL then I get the following result:
SELECT tp.* FROM themekey_properties tp WHERE enabled = 1
When I execute
dd($item)inside the foreach statement, I get the following result in the drupal_debug.txtThe bottom one without the "property" value (id = 5) is throwing the watchdog error.
"sub_acquia_marina" is the subtheme of 'acquia_marina". I will do some more debug backtrace to find the issue.
Comment #8
mkalkbrennerThe database entry for id 5 is corrupt. Can you access it in the ThemeKey administration interface?
I guess the property should be "drupal:path".
Comment #9
pachabhaiya commented@mkalkbrenner
Yes, I can access the ThemeKey administration page.
Attached a screenshot of what I see for id = 5.
Comment #10
tinny commentedIm getting the same error.
When a
drupal:path:wildcardis added thepropertybecomes the wildcard identifier. This is not a valid attribute in:$attributes = variable_get('themekey_attributes', array());Comment #11
jacob.embree commentedThe
drupal:path:wildcardbehaves that way for me as well, so the assumption that$attributes[$item->property]['page cache']exists is not a valid one, nor is it an error when it doesn't exist, so the check should be performed.