Hi,

After updating the node i am getting this error.
Notice: Undefined property: stdClass::$revision in themekey_ui_node_update() (line 328 of C:\xampp\htdocs\example\sites\all\modules\contrib\themekey\themekey_ui.module).

How do i fix this error
Please need help.

with thanks,

Comments

mkalkbrenner’s picture

Which Version of themekey was installed previously?

sakthiprogrammer’s picture

I used version 7.x-1.5 previously.
In that version i got same error and then I upgraded and checked, but again i got same error.
with thanks,

mkalkbrenner’s picture

You got this error in a previously working environment using 1.5 before you updated?

mkalkbrenner’s picture

Component: User Interface » Code / API
Assigned: Unassigned » mkalkbrenner
Priority: Major » Minor

I had a look at the code. It's a harmless notice not an error. You can safely ignore it for the moment.
I'll fix it for the next release.

ayan_d’s picture

Version: 7.x-2.2 » 7.x-2.0

Here is a quick fix to be added in themekey_ui.module file
replace the line :
if (!$node->revision && 0 < db_select('themekey_ui_node_theme', 't')

with

if (!isset($node->revision) && 0 < db_select('themekey_ui_node_theme', 't')

mkalkbrenner’s picture

Status: Active » Fixed

fixed and committed to git.

quick fix in #5 is not 100% correct because it evaluates to TRUE if $node->revision is 0 or FALSE. That differs from the original code.

ayan_d’s picture

@mkalkbrenner

Thanks for your update
we should then check
if ((!isset($node->revision) || !$node->revision) && 0 < db_select('themekey_ui_node_theme', 't')

mkalkbrenner’s picture

Status: Fixed » Closed (fixed)

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