I use the parent tokens of node relativity in conjunction with automatic node titles to give children the title of the parent. If the node object sent to hook_token_values is not a complete node object (which it doesn't appear to be in automatic node titles) the $node->parent_id is not set and the parent tokens can't be retrieved. The attached patch fixes this issue.

CommentFileSizeAuthor
#4 relativity-569386-4.patch637 bytesslip
patch.txt233 bytesbasvredeling

Comments

slip’s picture

Status: Active » Needs review

This is bug I've just come across after an upgrade. This patch fixes the problem. As this function only seems to need $node->parent_node, maybe we could replace the node_load() in the patch with a quick query. Either way, +1

slip’s picture

actually this problem seems to have been fixed for me in the dev version. I'll report back if it pops up again.

slip’s picture

nevermind. Still a problem in CVS. I reapplied this patch.

slip’s picture

StatusFileSize
new637 bytes

further improvement. the original made it so titles would only be set properly on update, not creation.

claudiu.cristea’s picture

Status: Needs review » Closed (duplicate)

Maybe you want to consider http://drupal.org/node/629650.

Marking this as duplicate.