D6 added support for revisioning taxonomy assignments.

Originally posted at:
http://groups.drupal.org/node/10840

CommentFileSizeAuthor
#7 taxonomy_views_field.patch1.41 KBcpugeniusmv

Comments

merlinofchaos’s picture

Status: Active » Fixed

What's weird is that I was already linking term_node to node_revision via nid, but when linking to the node table I was still using nid.

I think this is a case of me doing so much I couldn't see the forest through the trees.

cpugeniusmv’s picture

Status: Fixed » Active

I think I've found another place where this needs to be addressed. I've got a view that uses some "Taxonomy: All terms" fields (all of which are limiting terms by vocabulary, which seems to be working). What's not working is that I'm getting all of the terms from every revision.

I'm pretty sure the problem lies within the "views_handler_field_term_node_tid" class (in file: modules/taxonomy.views.inc) in the db_query call in the pre_render function.

I'm not at all familiar with the internals of views, so I hope that's clear enough.

merlinofchaos’s picture

You are correct; it's linking via nid when it should be vid.

merlinofchaos’s picture

Status: Active » Fixed

Fixed in CVS. Thanks!

cpugeniusmv’s picture

Status: Fixed » Active

The $vids variable was already being used in the previous revision on lines 364, 366, and 369 to conditionally add the AND for limiting terms by vocabulary. The use of $vids in the new revision for the revision IDs probably broke that.

merlinofchaos’s picture

Status: Active » Fixed

Yup, you're right. I'm way too tired to be doing this. I should've left that for tomorrow.

cpugeniusmv’s picture

Status: Fixed » Needs review
StatusFileSize
new1.41 KB

Hope you're not still up :). This turned out to be a pretty interesting problem.

The vid (vocabulary id) from the term_data table was conflicting with the vid (version id) from the term_node table in the result set. The patch gives the term_node.vid an alias, node_vid. I tested it out and it works for me.

merlinofchaos’s picture

Status: Needs review » Fixed

Oi. No, I went to bed. Thank you for the patch. I'm definitely ready to put THIS one to bed. =)

Anonymous’s picture

Status: Fixed » Closed (fixed)

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