Closed (duplicate)
Project:
Pathauto
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Mar 2009 at 20:37 UTC
Updated:
21 Apr 2009 at 00:00 UTC
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
Comment #1
gregglesThanks for your work debugging this!
Care to post a patch?
Comment #2
nonsiesee http://drupal.org/node/423132