2

Why isn't this view filtering correctly? I have four contextual filters applied to one view:

http://i.imgur.com/3wN6Q.png

The view is filtering a list of projects by four properties, Region, Client, Type, and State. When the view-page is loaded, all 4 arguments will be supplied. The problem I'm having is:

The first two arguments, Region and State, filter correctly. The last two: Type and State do not affect the filter.

http://i.imgur.com/9fVfG.png

The Type field isn't being factored into the query at all. You can see content with both Roadway and Airport values for the type field show up, but none for Asian or Military which are correctly filtered out values for the first two arguments (Region and Client).

I have tried remaking the filters, re-arranging the filters to make type first, re-entering some of the test content to make sure it wasn't corrupted.. no luck yet.

  • What would a URL look like? /region-1/client-1/mytype/california ? It could be that you're supplying a value that the filter cannot interpret, and then it simply displays all values – Johnathan Elmore Jun 18 '12 at 22:47
  • That is what the path would look like. I already double checked the values to make sure the one's I'm passing are within the dataset. Maybe it's an .htaccess issue? This should work fine right? – Bennett Miller Jun 19 '12 at 13:17
  • Yes, it should work fine. Can you give us a sample path? Also, what is the Contextual filter for Type configured as. – Johnathan Elmore Jun 19 '12 at 13:40
  • I added some screenshots for reference. – Bennett Miller Jun 19 '12 at 19:54
1

Okay- I figured out what was going on. I'm going to answer my own question in case anyone runs into the same problem I had.

Previously I had specified some PHP Validation code to the Type and State filters. Thinking they might be causing the problem I turned off the validation for both of them, but the problem persisted and that's why I posted my question above. To solve this you need to overwrite the previous validation you set by setting it to something like Basic validation, thus clearing out the old code. Now it works like it should but it seems like there is a bug in Views though that doesn't properly unset validation code. Good luck!

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.