Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a views (Export Views.txt & Capture 1.jpg) and I get the error in Capture 2.jpg. One taxonomy term exposed is configured as (Capture 3.jpg, Capture 4.jpg & Capture 5.JPG). The other taxonomy filter exposed is exactly the same but i select Catalog as the vocabulary (Capture 3.jpg). The OR/AND conditions are configured as Capture 6.jpg.
Am I doing something wrong?
Comment | File | Size | Author |
---|---|---|---|
#11 | 1102374-cleanup-add_filter.patch | 1.02 KB | dawehner |
#9 | 1102374-fix-operator.patch | 1.07 KB | dawehner |
#8 | 1102374-fix-operator.patch | 417 bytes | David_Rothstein |
#4 | vocabulary.jpg | 14.44 KB | EndEd |
#4 | error.jpg | 145.04 KB | EndEd |
Comments
Comment #1
dawehnerThis might be fixed in the meantime.
Therefore please update to the real latest version . It works fine here, see screenshot
Comment #2
EndEd CreditAttribution: EndEd commentedHi dereine. I just download the latest views version but I still have the same errors.
One thing i find different about your image attachment is that you dont seem to have WHERE in the query. It seem that you imported my attachment view but please, could you double check if the same conditions are applied on the filters as you see in (Capture 3.jpg, Capture 4.jpg, Capture 5.jpg & Capture 6.jpg)?
Also in your attachment i see the 'An invalid vocabulary is selected. Please change it in options.' Maybe as you don't have the exact same vocabulary as i have is not replicating the same conditions. I dont know.
In my case it partially works only if:
1. I remove the pager, selecting the 'display all item' option. I this case i dont get the error but if i select 2 or more terms from the same Taxonomy term exposed filter, it gives me 0 results and it suppose to give me around 8 results.
2. I don't use filter groups, all four filters (Capture 6.jpg) in the same group with OR or AND. Then I can use pagers but naturally, the result views page don't behave correctly and fulfill what i try to accomplish.
EDIT: The same thing happens with today 24/03/2011 dev
Comment #3
dawehnerThanks for testing.
This patch fixes the issue for me. Please test it.
Comment #4
EndEd CreditAttribution: EndEd commentedSorry for the delay and thanks for your patience. Yes the patch now remove the errors in the views UI but I noticed two things.
1. If i click the 'Reduce duplicates' on any or both taxonomy exposed filter to remove the option (see first post->Capture 5.jpg) and i try the views page and use the taxonomy exposed filter in any way i get (see this post->error.jpg).
2. Also i get a weird behavior if I try this:
Suppose I have a vocabulary with hierarchical terms like this (see this post->vocabulary.jpg). What I´m trying to do is using the previous posts views example, creating the two taxonomy exposed filters using only the 'subterms' terms (see this post->vocabulary.jpg). So the first Taxonomy exposed filter (lets called exposed1) have selected all the subterms childs of term1 (subterm1, subterm2 & subterm3) and the second Taxonomy exposed filter (lets called exposed2) have selected or the subterms childs of term2 (subterm4, subterm5 & subterm6).
In order to do that i have selected in both Taxonomy Exposed filters the 'Limit list to select items' option (see first post->Capture 5.jpg).
The problem when i try the view page and try to filter with exposed1 & exposed2 & those subterms I get this:
(take in account every subterm should give me 3 different results (nodes)).
Is this behavior correct? Am I doing something wrong or not taking something on account?
Comment #5
dawehnerOkay so this still needs work...
Just my 2cents: OH TAXONOMY.
Comment #6
EndEd CreditAttribution: EndEd commentedIndeed :)
Comment #7
dawehnerThanks for testing.
Okay commited the patch which fixed the errors,
but there are still additional bugs reported in #4
Comment #8
David_Rothstein CreditAttribution: David_Rothstein commentedI've hit a similar problem as the error.png screenshot shown in #4, under very similar conditions (though not exactly the same).
The attached patch fixes it for me. The full context is this:
The "else" statement (which the attached patch removes) is what seems problematic:
(1) Setting $value is unnecessary since it was already set above.
(2) Setting $operator to 'IN' overrides the actual operator, and therefore bypasses code below this that checks, e.g., for cases where $operator is 'or' and runs specific logic based on that.
Does that makes sense?
Comment #9
dawehnerThe change was part of http://drupal.org/node/1023794 and the patch was applied totally false.
So here is a change with some additional cleanup on top: change $this-handler->value to $value everywhere.
This code is really ugly.
Note: Before commit this someone would have to look at the d6 version and see how it's there.
Comment #10
David_Rothstein CreditAttribution: David_Rothstein commentedThe last part of the patch doesn't look right to me on a first glance... Because what happens if $operator starts off as 'or' and $options['reduce_duplicates'] is TRUE?
Then, this code will wind up switching the 'or' to 'IN'. But further down, the code does this:
so the end result will be that we started off with 'or' but wind up using db_and() in the query. I'm guessing that's wrong?
Here's a handy link: http://drupalcode.org/project/views.git/blob/refs/heads/6.x-3.x:/include...
I think it's consistent with not having to force the operator to 'IN' in D7, but I haven't studied it closely enough to be sure.
Comment #11
dawehnerYou are right.
This previous issue was basically just a 100% wrong commit.
The initial bug of the other issue was fixed with #955464: Missing join: 'taxonomy_term_data' creating a Glossary view based on taxonomy
So it's safe and just apply the patch in #8. Commited to 7.x
Here is a cleanup for the variable names and some documentation.
Comment #12
David_Rothstein CreditAttribution: David_Rothstein commentedI didn't actually test it, but that followup patch certainly looks good to me...
Comment #13
dawehnerCommited to 7.x
Thanks for the quick look up.