Hello, I tried creating an views exposed filter with a taxonomy vocabulary which has a hierarchy with terms under multiple parents and received the below error.
A
-1
-2
B
-3
-2
C
-4
-5
"Taxonomy: Term An invalid vocabulary is selected. Please change it in the options."
"Taxonomy: Term ID (with depth) An invalid vocabulary is selected. Please change it in the options"
I am selecting the correct vocabulary that I want to use. This works for vocabulary with terms not under multiple parents.
Is this a current limitation of Views?
I look forward to any advice =)
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 662174-must-keep-defined-options-not-in-form.patch | 2.96 KB | merlinofchaos |
| #10 | views-662174.patch | 1.95 KB | dagmar |
Comments
Comment #1
bwynants commentedI'm seeing several problems with exposed filters as well. The filter works if it's hidden and does not work when it's exposed.
This was for 'date' and 'numeric' so I guess there is a more general problem with exposed filters in 3.0 dev
Comment #2
Bilmar commentedAdditionally - using Exposed Filter; same vocabulary as above; Autocomplete - I get the below error.
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/example/public_html/drupal/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid.inc on line 295.
I am testing with the same vocabulary as above with a hierarchy of terms that have multiple parents.
Please let me know if more information is required to troubleshoot this. Thank you
Comment #3
Bilmar commentedto help picture what I am trying to achieve.
Train Line A
-Station 1
-Station 2
Train Line B
-Station 3
-Station 2
Train Line C
-Station 4
-Station 5
Where Station 2 is located on both Train Line A and Train Line B.
I would like to be able to used exposed filter to allow users to search for Node results on Station 2, whether they select it with Train Line A=>Station 2 or Train Line B=>Station 2
Comment #4
dagmar@bwynants: It seems related to #652716: Default Exposed Filters does not affect query.
@trupal218: can you confirm after apply 652716 that this still doesn't work?
Comment #5
Bilmar commentedhello dagmar-
I tested with 652716 and still encountering the issue. I narrowed it down to the 'Force single' bit in the exposed filter setting.
1) With the bit checked (forcing this exposed filter to accept only one option) the filter shows up without a problem and works great.
2) With the bit not checked off (to allow user to select multiple) I get:
"Taxonomy: Term An invalid vocabulary is selected. Please change it in the options."
Reason to allow multiple:
I would like users to be able to select several stations at once then submit for search.
Further testing:
When I change the exposed filter taxonomy vocabulary to one I created where terms do not have multiple parents, I am able to uncheck 'Force single' in the settings and it works great. The problem looks to be when the vocabulary has terms with multiple parents, and I set the setting to allow multiple selection in the filter.
Please let me know if more information is required. Thanks!
Comment #6
dagmarThanks trupal218, changing category.
Comment #7
merlinofchaos commentedMost likely this is an artifact of the export retooling and the extra data needed is not being adde din option_definition() and therefore not being stored.
Comment #8
Bilmar commentedsorry, I wasn't clear on #7 but I read it as I need the Description information filled in the taxonomy terms so they are 'complete', so I went into the taxonomy and added Description text for each term in the vocabulary. I re-tested creating the exposed filter and still encountered the same error.
My guess is that I read your comment completely wrong but just wanted to share that I tried the above.
Thanks!
Comment #9
merlinofchaos commentedSorry, I was saying I think this is a bug created by an earlier patch (and one of the reasons I believe the 3.x-dev version to not be terribly stable just now) and that this particular filter needs more data in the option_definition() method of its class.
Comment #10
dagmarHere is a patch.
I'm not 100% sure if this is the best way to remember the values selected by the previous form, maybe using option_submit() we can do the same.
@merlinofchaos, if you have a better way to code this patch let me know, and I will rebuild it.
Comment #11
Bilmar commenteddagmar - thank you very much for such a quick patch! Patching went smoothly and I was able to create the exposed filters without any errors. (sorry for the delay in feedback, moved apartments over the weekend and was without internet)
merlinofchaos - I really appreciate your explanation in #9 for me in your busy schedule.
I look forward to hearing your comments on dagmar's patch when you have a moment.
Thank you
Comment #12
merlinofchaos commentedThe trouble here was deeper than that and part of the retool. I believe this patch takes care of it -- basically we need to make sure that items that *are* defined have their values preserved while we drop items that do not have a definition.
Comment #13
dawehnerand fixed