Taxonomy terms in node path bulk update
bobzillaforever - November 10, 2009 - 18:30
| Project: | Pathauto |
| Version: | 6.x-1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
This is a problem specifically related to using the Hierarchical Select module in combination with pathauto.
Issue is, if I create an automated alias on an individual node, the alias is built correctly (IE: mysite.com/my-brand/my-parent-category/my-child-category/my-product), but when doing a bulk update, the whole taxonomy tree is dropped (IE: mysite.com/my-product). I've been using [save-lineage-termpath-raw:2]/[save-lineage-termpath-raw:3]/[title-raw] for my pattern.

#1
Okay, so I found a fix.
In the
$nodeobject being passed intohook_nodeapi(), I noticed that$node->taxonomywas a multi-dimensional array, with the first dimension being a vocabulary, and the second being the terms inside that vocabulary. The$node->taxonomyin the bulk update function was a one-dimensional array, with only the taxonomy term IDs. This patch runs through the taxonomy terms associated with a node and converts them to a multi-dimensional array before creating the node's alias.