I found out that when using revisions and taxonomy on a node, pathauto doesn't seem to grab taxonomy information from the latest revision. I only noticed it when I changed a taxonomy term on a node which was to be used in the URL. It was still grabbing the taxonomy term from the 1st revision.

The fix is a SQL call in pathauto.module at line 115. Needs to be changed to:

$category = db_fetch_object(db_query_range("SELECT t.tid, t.name FROM term_data t INNER JOIN term_node r ON r.tid = t.tid INNER JOIN node n ON r.nid = n.nid WHERE t.vid = %d AND r.nid = %d AND r.vid = n.vid  ORDER BY weight", $vid, $object->nid, 0, 1));

All I added was an inner join to the node table which has the current revision information.

Comments

greggles’s picture

Thanks for your work debugging this!

All I added was an inner join to the node table which has the current revision information.

Care to post a patch?

nonsie’s picture

Status: Active » Closed (duplicate)