If the 'attach Location Taxonomy terms to nodes' function is used and the 'location_taxonomize_terms' field allows only one value, then the last value should be assigned in the hierarchy.

Example: Country -> Province -> CITY (the city term should be assigned to the node field)

At the moment only the first value (country, in the example) is stored.

CommentFileSizeAuthor
#2 reverse-terms-hierarchy-1370702.patch3.56 KBcbeier

Comments

goron’s picture

Title: Attach only the latest term (in the hierarchy) to a node » Attach only the latest term (in the hierarchy) to a node if field allows only one value
Version: 7.x-2.2 » 7.x-2.x-dev
Assigned: Unassigned » goron

I like the idea. Will work on this soon.

cbeier’s picture

StatusFileSize
new3.56 KB

In a project I have it implemented, spontaneously and "dirty". However, even without settings options. Actually, it is sufficient to reverse the $tids array.

goron’s picture

Status: Active » Needs review
goron’s picture

Status: Needs review » Fixed

Thanks for the patch. I committed this in -dev. New release coming soon!

cbeier’s picture

Status: Fixed » Active

Just as I see it is that the array_reverse() is only executed when the bulk import is running. And not event when a single location record is edited. This could result in a chaos in the taxonomy. Or is see that wrong?

goron’s picture

Status: Active » Fixed

oops, thanks for catching that! That could have made a lot of mess.

Fixed it.

hutch’s picture

Great! I can stop scratching my head now ;-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.