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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

spiderman’s picture

Status: Active » Needs review
FileSize
698 bytes

... and the patch, against the 5.x-1.11 version of token_node.inc :)

spiderman’s picture

FileSize
698 bytes

umm.. 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!)

Dave Reid’s picture

Status: Needs review » Closed (duplicate)