This version circumvents a bug in pathauto.
Bug: Pathauto is missing a check if the pathauto-specific node data is being set when updating/creating a node. Other modules shouldn't have to worry about pre-populating the data when calling node_save().
Symptoms: Pathauto seems to be inaccurately determining if there has been a change to weather a node is using pathauto or not. This is causing a problem in the lingotek module when translating url aliases by not respecting the setting.
I've managed to locate the culprit code. I'm using pathauto 7.x-1.0. In pathauto.module:460 in the pathauto_node_update_alias function:
if (isset($node->path['pathauto']) && empty($node->path['pathauto'])) {
Should instead read:
if (!isset($node->path) || isset($node->path['pathauto']) && empty($node->path['pathauto'])) {
What's happening is the hook to create and/or update in pathauto is looking for node elements populated by it's module, probably from the edit page. However if an automated request to save a node is made that isn't made when the edit form is present, then no such data is passed. In other words, any module which calls node_save() has the pathauto enabled for that node, even when it's not intended.