Hi,
I did get a sql-error in node-module::load_node() when previewing or saving a new node (and actually not even using node hierarchy but using Token in that auto-title thing).
After a bit of looking through the code I figured out that it was caused by an empty parameter, and that the function-call lies in "nodehierarchy_token.inc".. the error lies in the following lines:

  if ($type == 'node') {
    $node = $object;
    $parent = node_load( $node->parent );

there's is no check if $node->parent is actually set, and as (god knows why) it wasn't set in my case, that triggered the error.
A simple "&& isset($object->parent)" added to the if-condition seems to do the job for me... hope I'm not missing anything ;-)

CommentFileSizeAuthor
nodehierarchy_token.patch465 bytesbforchhammer

Comments

ronan’s picture

thanks for the patch, I'll test and apply as soon as I get a chance

R

ronan’s picture

patch looks good. Committed it with some minor changes.

Thanks again and sorry it took so long for me to get around to this

Ronan

ronan’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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