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.
When configuring advanced search to provide taxonomy terms, these are not listed.
Please advise.
Comments
Comment #1
Vanilys CreditAttribution: Vanilys commentedSubscribing
Comment #2
prathK CreditAttribution: prathK commentedI found that in the basic search form of D6 Categories come by default.
But in case of D7 categories are not coming under the advanced search.
It seems some problem for building the search_form itself without categories.
I guess using the form_alter we have to add the fields which are configured in the
custom_search_taxonomy by fetching the whole taxonomy.
Looking into it and will update the patch for the same.
regards,
PrathK
Comment #3
prathK CreditAttribution: prathK commentedHi Vanilys,
It seems that there was form_alter present in node.module itself in D6 which was adding taxonomy.
But in D7 it was removed for some purpose and again it might be added in D8.
You can see the following post for the reference.
Optional Exclusion of Taxonomy Vocabulary from Advanced Search
This will be fixed in D8 core node.module automatically.
Also you can check the patch given on the same link for D7.
prathK
extrimity.in
Comment #4
Ambient.ImpactI'm also having this problem with 7x-1.11, but only on the results page - the blocks work fine. Has anyone encountered this variation?
Comment #5
Ambient.ImpactIf anyone is looking for a quick for this in Drupal 7, I've attached a simple module I slapped together to re-add the taxonomy select box, based on the Custom Search settings for each vocab. Enjoy.
Comment #6
jdanthinne CreditAttribution: jdanthinne commented@Ambient.Impact: Can you provide a patch instead? It would be easier for the other users to try your solution…
Comment #7
Ambient.ImpactFair enough. I'm not as familiar with generating patches as I'd like to be, so let me know if there's anything I've done wrong and I'll re-upload it.
Comment #8
sonictruth CreditAttribution: sonictruth commented#7 is a good start however it doesn't respect any of the settings on the admin/config/search/custom_search/taxonomy page.
I've made a start with the field type however to get this fully working it would need to incorporate the label, label visibility, depth and 'all' string.
I'll keep going with the rest if time permits but this should be a help to some.
Comment #9
akosipax CreditAttribution: akosipax commentedThe patch above does not take into account multiple taxonomies. (or maybe it does but it just doesn't work)
... removing the reset function solved it. the reset function returns the first element, that's why only the first vocabulary gets to be the option.
Comment #10
Proteo CreditAttribution: Proteo commentedHi, I'm having this issue too. I tried the patch at #8 but it won't apply to the latest dev version (7.x-1.13+7-dev, error is: "Hunk #1 FAILED at 115"). Any chance to get a revised patch?
Comment #11
internets CreditAttribution: internets commentedPatch also failed for me against 7.x-1.13+7-dev. I'm trying to make a fix but haven't had success yet...
Comment #12
golddragon007 CreditAttribution: golddragon007 commentedHuh, finally I did it. That patch was for the 20144e64494c83a448067d587e59df5d7e4780bb commit. But it seems that doesn't meter, because there was a lot of changes which caused than a lot of bugs... So basically I rewrote the patch.
You can set if you want to display in the advanced search box the taxonomies, at the admin/config/search/custom_search/results page. This is in default true.
But it won't display, if you don't choose 'selector type' at the admin/config/search/custom_search/taxonomy page.
Result:
Note 1: I copied the custom search block's taxonomy code for advanced search.
Note 2: I changed the advanced search's form submit target to custom_search_submit function, which maybe can cause some bugs. If somebody is more familiar with this code part, please check it. (it seems it works correctly, but who knows?)
Tested/Test results:
Selector type: drop-down list, drop-down list with multiple choices, radio buttons, checkboxes
Checkbox js works
Doesn't show terms in searchbox (at content)
Automatically selected the correct options in the advanced panels at advanced result page after search
Correctly select 'any' option (and any other option)
Doesn't multiply same tags at research
Tested with multiple tags. (show only at advanced result page in the box, the results wasn't tested at multiple vocabulary tags)
Hide at result page the taxonomy if uncheck the checkbox at admin/config/search/custom_search/results OR if you select 'Disabled' at admin/config/search/custom_search/taxonomy .
Comment #13
HannahMR CreditAttribution: HannahMR commented**removed**
Comment #14
Mario Steinitz