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.
The reset link appear only when some facet filters are selected. It could be also usefull to make it appear when search keys are submitted.
Comment | File | Size | Author |
---|---|---|---|
#7 | add_reset_link_on_search_keys-2376711-7.patch | 4.13 KB | mlanth |
#6 | add_reset_link_on_search_keys-2376711-4.patch | 5.11 KB | PaulDinelle |
#2 | add_reset_link_on_search_keys-2376711-2.patch | 1.92 KB | drikc |
Comments
Comment #1
drikc CreditAttribution: drikc commentedThe attached patch make the reset link appear also when search keys are submitted.
Comment #2
drikc CreditAttribution: drikc commentedFix compatiblity with php < 5.5.
Comment #3
PaulDinelle CreditAttribution: PaulDinelle at Fenix Solutions Inc commentedI used this patch for a bit, but after customizing my search key and combining it with current_search_links module (to display reset buttons beside each facet), this module would no longer clear out keywords.
I've updated the patch to add in a custom settings field for the search keyword (mimicking the current_search_links module) so that the keywords could be properly removed. It meant I had to duplicate the CurrentSearchItem settings form, but I couldn't see a way around this.
Hope this helps someone else!
Comment #4
PaulDinelle CreditAttribution: PaulDinelle at Fenix Solutions Inc commentedComment #5
PaulDinelle CreditAttribution: PaulDinelle at Fenix Solutions Inc commentedHmm, my patch still doesn't work 100% with current_search_links module.
Comment #6
PaulDinelle CreditAttribution: PaulDinelle at Fenix Solutions Inc commentedOkay, fixed an issue with the filter intersection list. If the first entry was empty (as is the case if removing the parent term in a hierarchy-enforced list), it was accidentally including the second filter in the reset link query.
Comment #7
mlanth CreditAttribution: mlanth commentedPatch re-roll to reflect newer module version.