having the following configuration:

views content pane:
a contextual filter: has taxonomy term id
override title: Related News for %1
Allow multiple values
validation with filter type: Term IDs separated by , or +

the views pane preview works for single and concatenated term id's as contextual filter argument.

what doesn't work is embedding the views pane sucessfully into a panel:

panel for node template
context: relationship "Multiple terms from node" for a specific vocabulary with option OR + as concatenator
content: passing the context to a views content pane as "Term ID of all term, separated by + or ,"

the argument seems not to get passed. it will when using "Term ID of first term" instead of "Term ID of all term, separated by + or ,"

this is related to the support request #1111384: How to create a panel with related content based on multiple terms.

Comments

subscribe

There was a problem here a while back that had to do with the fact that there are actually two entity term contexts -- original one and the entity based one -- and the multiple terms one is kind of off in lala land. I could swear I fixed that but maybe I missed something. :/

subscribe

subscribe.

I've just been doing a bit of messing around with this trying different combinations of +d together term Ids directly into the views preview function and getting the behaviour there too, when panels hasn't come into play at all. Not sure if that helps narrow it down a bit (...or if that is old news, fixed and my views module is a little out of date)

Edit: having re-read an actually retained the original post. it seems my info is at odds with the initial info. disregard as appropriate :)

Subscribing, just in case that new follow button is just for show.

Couldn't this be a ctools related problem? Maybe the relationship-plugin in ctools/plugins/relationships/terms_from_node.inc ? When I'm not misstaken the (+ OR)-concatenator did work for me but not (, AND).

By the way: I still dont have any problems creating related content based on multiple tid's by using content:has taxonomy term ID. Without any arguments from panels, without any specification of validation and without any additional relationships. Just allow multiple values.

Using last devs of all

Assigned:Unassigned» merlinofchaos
StatusFileSize
new4.81 KB
new2.44 KB

I can't reproduce the original problem, as I get a SQL error when I try.

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1', '2'' at line 1: SELECT tid, name FROM {taxonomy_term_data} WHERE tid IN :tids_0, :tids_1; Array ( [:tids_0] => 1 [:tids_1] => 2 ) in ctools_context_terms_convert() (line 84 of [path]/sites/all/modules/ctools/plugins/contexts/terms.inc).

Looks like missing () after IN?

For future reference, please, please upload exports of views/pages. It makes it a great deal easier to debug for me.

I have the same issue without Panels, I'm only using Views 7.x-3.0-rc3.

To reproduce:

  • Add a contextual filter "Content: Has taxonomy term ID"
  • Check "Allow multiple values"

When I add 1 tid as an argument, the results are as to be expected.
When I add "tid1,tid2" or "tid1+tid2" as an argument, no results are returned.

I also tried this with the option "Filter value type" > "Term name converted to Term ID" but this didn't change the results.

Priority:Normal» Major

This would seem to require a new "Filter value type" that combines "Term name converted to Term ID" and "Term IDs seperated by , or +".

Update: This ticket seems to do just that: #1248300: Contextual filters: Taxonomy filter validation using multiple term names. I'm not sure if this feature/bug falls in the scope of this issue though.

The views patch in the above post doesn't seem to work properly.

StatusFileSize
new4.88 KB

I've attached a Feature with a content type, view and panel that works if there's only one term reference field on the node.

But when there's two or more term reference fields, and the fields have content in them on the node...

I think I've managed to identify the problem.

Everything works OK until you have more than one Term reference field in the content type, with terms in it

With only one term reference field on the content type, if the panel content view Taxonomy term: Term ID is set to "Term ID of all term, separated by + or ," everything seems to work OK. The panel sends multiple term IDs to the view and the panel's view pane shows the multiple terms.

If you add a second term reference field to the content type, the panel still displays the above view properly...

until you add/select terms in the second term reference field on the node...then the panel stops sending "Multiple terms from node" to the view for the first term reference field.

The above issue exists regardless of whether the panel's Context > Relationships > Multiple terms from node > Vocabulary boxes are checked for both, either, or none of the above vocabularies.

To recreate the issue with ctools, views and panels modules installed

1. Create a simple 'Colours' vocabulary and add terms 'Red, Green and Blue' - (admin/structure/taxonomy/add)

2. Add a 'Colours' taxonomy field to the Articles content type...widget 'select list' or 'auto complete' and number of fields 'Unlimited' - (admin/structure/types/manage/article/fields)

3. Create a 'Colours View' with machine name 'colours_view' - admin/structure/views/add

  • Show 'Taxonomy Terms' of type 'Colours' sorted by 'unsorted
  • Name 'Colours', path 'colours'
  • Unformatted list of 'fields'

In admin/structure/views/view/colours_view add 'Taxonomy term: Term ID' context filter

Set 'WHEN THE FILTER VALUE IS IN THE URL OR A DEFAULT IS PROVIDED' to:

  • Specify validation criteria - Validator > Taxonomy Term > Colours
  • Filter value type - Term IDs separated by , or +
  • More - check the box for 'Allow multiple values'

4. Create a node template panel for Articles - admin/structure/pages/nojs/operation/node_view/actions/add with:

  • Selection Rules - Node Type: Article > All criteria must pass.
  • Contexts > Relationships - Multiple Terms from Node > select 'Colours' vocabulary
  • Choose Layout - Any
  • Panel Settings - Default
  • Panel Content tab, add content > Views > Colours View > Taxonomy term: Term ID > Multiple Terms from Node > Term IDs separated by + or ,
  • Create Variant

5. Create an article and select two or more options from the colours field - save the page and it should show the colours listed in the view

6. Edit the node, add anything to the 'Tags' field and save the page - the above 'Colours View' will disappear

  • The same applies when using any other additional terms reference
  • From post #6 - using Concatenator + (OR) or , (AND) doesn't seem to make any difference...neither works

I don't know if it helps, but configuring the view pane's settings to Taxonomy term: Term ID > Term ID of first term doesn't result in the above issue.

Unlike Taxonomy Term IDs separated by + or , the Term ID of first term option produces the required view even when there are multiple term reference fields on the node

It looks like a fix for this issue could also fix several similar Panels issues - http://drupal.org/node/1111762 and possibly this one - http://drupal.org/node/1424020

as well as many Panels-related issues in the Views module like http://drupal.org/node/1369772

@StuartDH you are right. The other issues are duplicates of this and a fix here should fix the others too. I'm having the same issue here. I have not taken the time to digg deeper in the filter and see what happens. But I have the same setup as people before described and get no result with more then one term but I have good results with only one term.

+1

Status:Active» Needs review

Looks as though this is now fixed.

All looks OK when creating something similar to #14 with Drupal 7.12, Ctools 7.x-1.0, Panels 7.x-3.2 and Views 7.x.3.3

Status:Needs review» Fixed

'needs review' means there's a patch.

Thanks StuartDH for your hints. I managed to configure my panel/view.

Status:Fixed» Closed (fixed)

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

Status:Closed (fixed)» Active

Sorry, reopening. I am experiencing exactly the same issue as described in http://drupal.org/node/1285012#comment-5724598 using
Drupal 7.17, Ctools 7.x-1.2, Panels 7.x-3.3 and Views 7.x.3.5.

When selecting a single term on my node the view is displayed by panels. As soon as I select multiple terms the view disappears.
I have tried using both a View with master display in my panels as well as a Content pane (I setup the arguments to accept multiple tid's).

Issue summary:View changes

I am also experiencing this issue:
Drupal 7.26
Ctools 7.x-1.4
Panels 7.x-3.4
Views 7.x-3.7

Selecting a single term allows the term id to pass to the panel but using multiple terms causes the contextual filter to invalidate.