Download & Extend

No way to use "any tid" as default contextual filter

Project:Views
Version:6.x-3.x-dev
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:Crell
Status:patch (to be ported)

Issue Summary

Currently, the default argument plugin for "Taxonomy term ID from URL" lets you pull taxonomy terms from a node in the URL instead. This is great for doing "related nodes" blocks, as the labeling says. However, it's currently hard coded to interpreting multiple terms as "has all terms", not "has any term". That should be made configurable so that nodes with lots of terms don't end up with nothing that's related to them. :-)

I'm going to give this a shot, so assigning to me.

Comments

#1

Status:active» needs work

OK, this is as much as I can do right now. Unfortunately it doesn't work yet. The net result from this patch is that you can change the query from "WHERE taxonomy_index.tid='1,2,3'" to "WHERE taxonomy_index.tid='1+2+3'". However, neither of those queries should work at all given that tid is not a string column, yet for some reason the commas work while the + does not.

I'm confused, but do not have any more time to work on this issue sadly. :-( Hopefully someone else can drive it home.

AttachmentSizeStatusTest resultOperations
views_anyall.patch1.88 KBIgnored: Check issue status.NoneNone

#2

Version:7.x-3.x-dev» 6.x-3.x-dev
Status:needs work» patch (to be ported)

The patch looks fine in general.

The bug you report about the non working connection of multiple terms seems to be a problem of your configuration.
On your contextual filter under "more" you can find "Allow multiple values".

With this settings and distinct enabled it works as expected.
This patch should be backported to 6.x-3.x

#3

Yeah, I checked after posting this and I didn't have that setup right when I thought I did. I've not tried the patch with that setting checked yet, and I don't know that I will be able to do so in the near future. I also don't know that I'll be able to do a D6 backport as the project funding it is D7. :-(

#4

Status:patch (to be ported)» needs review

OK, I've confirmed that it does work in D7 after I configure the View properly. The only catch is that the title of a resulting View page becomes "nodes tagged tag1+tag2+tag3". I think that's a separate issue, however.

#5

Status:needs review» patch (to be ported)

Update status back

nobody click here