Closed (duplicate)
Project:
Chosen
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Sep 2013 at 05:22 UTC
Updated:
25 Sep 2014 at 09:23 UTC
Jump to comment: Most recent
I just updated to 7.x-2.0-alpha4, and now when using chosen on a taxonomy field that has hierarchy, I cannot search the items in a lower category. It only searches the top level listings.
I tried to revert back but I guess it updated my database already so nothing changed.
How can I fix this?
Comments
Comment #1
hydra commentedDon't worry, nothing happended to you database, chosen only does frontend stuff. So nothing is lost. I will have a look into it later, thanks for reporting this.
Comment #2
eric_a commentedI just noticed this in 7.x-2.0-alpha4+7-dev. I get results if I add the depth character myself, but I don't always know which level to search :-)
@surfkid, which version did you update from?
Comment #3
adshill commentedYeah this is because it includes the dash in the taxonomy heirachy. It works if you type in "-term" which is not really useful.
Thus the module unfortunately is not ready for heirachical taxonomy. If I were a programmer I'd try and fix it, but I'm afraid I'm not :(
Comment #4
nsshrinivasan commentedI had to identify the items within a hierarchy that starts with "-" which indicates a sub level and then use the rest of the text to do the search string match.
Here is what I added to the search_string_match function:
Here is the context of where it fits into:
Comment #5
ben.bunk commentedThe above change is in the chosen jquery plugin. Hopefully there is another way to address this.
Comment #6
nsshrinivasan commentedThere is a configurable option that is available in the jquery chosen plugin library called "search contains", documentation is available here http://harvesthq.github.io/chosen/options.html. This configuration can be configured via Configuration -> Chosen -> Search also in the middle of words option which allows to search text anywhere in the word(as opposed to "starts with" search).
Comment #7
margyly commentedI need this, too. Otherwise I have to tell my users to type a "-" to see what values are in the second level of the hierarchy. Wish I could fix it!
Comment #8
batigolixnsshrinivasan's suggestion to check "Search also in the middle of words" at Configuration > Chosen > Search works perfectly.
Comment #9
batigolixDuplicate of #1835390: Finds nothing with lists that have a taxonomy hierarchy