I'm currently getting this error in my views setup:

SQLSTATE[21000]: Cardinality violation: 1241 Operand should contain 1 column

I'm not sure why its giving this error as it seems like it should work. I have a contextual filter that matches taxonomy term id's. I have it configured to pass in an array() of tid's, but it throws the error if its more than one. What could be wrong?

Below are screenshots of my setup and sql statement generated by views:


enter image description here enter image description here


Reading the instructions for multiple views contextual filter arguments you get the solution:

Allow multiple values: If selected, users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND).

So if you need an OR operator you should return a string of "1+2+3" and if you need an AND operator you should return a string of "1,2,3".

So don't return an array() but a string.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.