tracked down a pathauto bug on a site under development tonight, which turned out to be a small bug in token_node.inc. it turns out that when a node is in the midst of being created (ie. during the pathauto_nodeapi create op) that the $node object it passes to token doesn't have the ->name field set, presumably because the node is not-yet-saved.
simple workaround seems to be for token to check if the $node object has a ->name field set, and if not, then call user_load and fill the name field with $user->name. perhaps this is rightly considered a pathauto bug, but i found it simpler to patch token_node.inc
Comment | File | Size | Author |
---|---|---|---|
#2 | token_node.324000.patch | 698 bytes | spiderman |
#1 | token_user.324000.patch | 698 bytes | spiderman |
Comments
Comment #1
spiderman... and the patch, against the 5.x-1.11 version of token_node.inc :)
Comment #2
spidermanumm.. is it late at night, or something? here's a proper patch which loads a user object, as described above (not even sure how the previous patch worked!)
Comment #3
Dave ReidDuplicate of #366370: $node->name is undefined when using nodeapi('insert') which should be backported.