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.
Hello,
I added a filter Taxonomy: Term, chose a Vocabulary, Autocomplete, Exposed and then pressed update which resulted in the below user warning.
user warning: 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 ')' at line 1 query: SELECT * FROM term_data td WHERE td.tid IN () in /home/abckonec/public_html/beta/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid.inc on line 298.
Screencast of issue appearing: http://www.screencast.com/users/trupal218/folders/Jing/media/0f71421c-19...
An example of what the taxonomy vocabulary looks like (also terms are originally inputted in Japanese):
A
-1
-2
-3
B
-4
-1
C
-5
-1
D
-1
-2
-3
-4
-5
I've testing this filter on Views 2 and it worked fine before I remember. Just added this filter again today with Views 3 and got this result.
Please let me know if more info is needed. Thanks!
Comment | File | Size | Author |
---|---|---|---|
#24 | 721774-admin_summary-fix.patch | 476 bytes | mattew |
#18 | 721774-debug-output.patch | 709 bytes | Wim Leers |
#4 | user warning.png | 41.92 KB | Bilmar |
Comments
Comment #1
Bilmar CreditAttribution: Bilmar commentedI'm still unable to add a "Taxonomy: Term" filter with any vocabulary (new or old) to my view =/
However, I am able to create a "Taxonomy: Term ID (with depth)" filter.
Please let me know if anyone can give advice on this issue.
Thanks very much in advance!
Comment #2
phpberlin CreditAttribution: phpberlin commentedhai and hello
i've exact the same problem as trupal218
by uising views and taxonomie filter and autocomplete
any suggestions?
thnaxx
Comment #3
dawehnertrupal218: Can you make a step by step report?
Then fixing would be trivial, i think. Thanks!
Comment #4
Bilmar CreditAttribution: Bilmar commentedHello,
Please see the screencast that shows issue at http://www.screencast.com/users/trupal218/folders/Jing/media/4818c94d-ca...
Views 6.x-3.x-dev (2010-Mar-09)
Steps to reproduce:
1) I created a new taxonomy vocabulary with default settings
2) I add some terms to the vocabulary (A, B, C, D, E, F)
3) I created a new view (type node in my screencast) and add filter Taxonomy: term
4) I select the taxonomy vocabulary 'example' with autocomplete and make it Exposed
5) press update and live preview will show the warning message
In the screencast the error shows on a brand new view created as well as a existing fully setup view with many fields (my search page)
@dereine - please let me know if this is enough information to troubleshoot this.
I really appreciate your support!
Comment #5
dawehnerAnd i appreciate your incredible awesome bug repots. Compared to nearly every other issue its much much much better. Really you do it perfect.
I reproduced it step by step, but there is still no error. The good thing is that this error messsage can only be seen by the administration. Could you expose the view? Perhaps there is a space or something like this.
Comment #6
Bilmar CreditAttribution: Bilmar commentedI appreciate your comment! I try my best to provide as much information to you guys =)
I am trying to learn more and more about Drupal, and I apologize for times when my questions are considered very simple from your side.
I know I speak for the whole Drupal community when I say we all appreciate your work very very much!
With further testing of enabling/disabling other modules, I have found the culprit! It was Hierarchical Select Taxonomy Views.
Disabling this submodule of HS makes the errors go away. This use to work before (in Views 2) so I wonder if there is something HS needs to update to work with Views 3? If there is nothing that may come to mind I will route this issue to HS queue and ask Wim Leers for assistance.
Regards
P.S. Wim Leers was the one who introduced me to www.jingproject.com for screencasts. very cool!
Comment #7
dawehnerOh cool, so this is fixed now.
Comment #8
Bilmar CreditAttribution: Bilmar commentedHi Wim Leers,
The error shown at #4 is being caused when Hierarchical Select Taxonomy Views is enabled with Views 3. I have also included a screencast. When Hierarchical Select Taxonomy Views is disabled the warning message goes away. Would you kindly look into this warning message?
Please let me know if more information is needed.
Regards
Comment #9
Wim Leers(Moving back to the Views issue queue temporarily to get some feedback on how to fix this.)
dereine, I have no clue where to begin looking for the cause. Why does a Views plugin that works just fine with Views 2 all of a sudden stop working with Views 3? And especially: how could it cause an SQL error?
The code should read like butter to you: all I do, is subclassing
views_handler_filter_term_node_tid
. I override 7 methods (it's less than 250 lines of code, with probably over half of it comments). It must be the exposed input handling that has changed and that's therefore triggering this problem — because only when theaccept_exposed_input
method returns true, Views will alter the query, based on the input set by Hierarchical Select.I'd appreciate your pointers here :) — I don't think there's Views 2 API -> Views 3 API upgrade documentation available? If there is, I could not find it.
Comment #10
dawehnerWhat does your widget return if there is no term selected?
I think $this->value is not an array, as views expect it to be. I don't know what the value is here, but it could be a multi-dimensional array.
Comment #11
robby.smith CreditAttribution: robby.smith commentedsubscribing
Comment #12
phantomvish CreditAttribution: phantomvish commentedsubscribing.
Comment #13
arbel CreditAttribution: arbel commentedI have the same issue but with views 2
exposed filter with autocomplete on a taxonomy term id - selecting a simple one level vocabulary that doesn't have HS activated.
when I disable HS the error goes away.
this is very strange since this shouldn't have anything to do with HS.
Idan
Comment #14
thapar CreditAttribution: thapar commentedI would really like to use Hierarchical Select with Views, but unfortunately this means that I will have to disable it to prevent the error.
I should also mention, that I get the error in the same way as the OP, except I am using Autocomplete with Term ID (but also exposed).
Please help! Thanks!
Subscribe?
Comment #15
Wim LeersDoes this problem still exist in 3.5?
Comment #16
gianfrasoft CreditAttribution: gianfrasoft commentedYes, I had this problem after setting up the label on a taxonomy views filter made with a HS widget.
Comment #17
Wim LeersI don't have time to look into this. I'll happily review & commit a patch that fixes this :)
Not critical, but minor because it appears to bother very few users.
Comment #18
Wim LeersRegarding #10:
$this->value
is always an array, since this is the code:So, to debug the problem, I'll need some user that is experiencing this problem to 1) install and enable the devel module, 2) apply the attached patch, 3) try to reproduce the problem, 4) report back the output generated by this patch.
Comment #19
ifitri CreditAttribution: ifitri commentedI had the same problem and got two empty arrays on screen.
So I added the line:
after the typecast to array that Wim just pointed out in #18.
The errors are gone, all seems to work.
Comment #20
dsbrianwebster CreditAttribution: dsbrianwebster commentedsubscribing +1
Comment #21
1richards CreditAttribution: 1richards commentedsubscribing.
Comment #22
brunorios1 CreditAttribution: brunorios1 commentedsubscribing...
Comment #23
gazzur CreditAttribution: gazzur commentedI'm using Views 2, HS 6.x-3.7 and Drupal 6.13. #19 fixed the issue for me.
Comment #24
mattew CreditAttribution: mattew commentedHi everybody,
Same issue with View2 and Hierarchical Select.
So I just created this patch (in SVN format) related to the #19 tips, wich has fix the problem for me.
Very big thanks to ifitri !!!
Best regards,
Comment #25
stefan.r CreditAttribution: stefan.r commented6.x issue without activity for over 3 years, closing.
Please reopen if this is still an issue in 7.x.