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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | relativity-569386-4.patch | 637 bytes | slip |
| patch.txt | 233 bytes | basvredeling |
Comments
Comment #1
slip commentedThis 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
Comment #2
slip commentedactually this problem seems to have been fixed for me in the dev version. I'll report back if it pops up again.
Comment #3
slip commentednevermind. Still a problem in CVS. I reapplied this patch.
Comment #4
slip commentedfurther improvement. the original made it so titles would only be set properly on update, not creation.
Comment #5
claudiu.cristeaMaybe you want to consider http://drupal.org/node/629650.
Marking this as duplicate.