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.
Currently all exposed filters are text fields. In views out-of-the-box (mysql views), you have the option of showing a dropdown (select input) instead of just typing in the term. This issue is about adding that dropdown.
Since https://www.drupal.org/node/1807028 is a general call-out to increase the options for exposed filters, this task is about specifically improving the display of term filters. The patch attached here comes from #11 of that issue, and is acting as a starting point for this issue.
Comment | File | Size | Author |
---|---|---|---|
#14 | interdiff-9-to-10.txt | 1.33 KB | Aron Novak |
#14 | apachesolr_views-exposed_term_dropdown-2394943-10.patch | 7.31 KB | Aron Novak |
#9 | interdiff-2-to-9.txt | 1.09 KB | mariacha1 |
#9 | apachesolr_views-exposed_term_dropdown-2394943-9.patch | 7.08 KB | mariacha1 |
#7 | apachesolr_views-exposed_term_dropdown-2394943-2.patch | 7.15 KB | mariacha1 |
Comments
Comment #1
mariacha1 CreditAttribution: mariacha1 commentedHere's the patch in the initial comment cleaned up and rerolled for -dev.
Comment #3
mariacha1 CreditAttribution: mariacha1 commentedThis is weird. The patch applies at hash adfeef6 locally...
Comment #7
mariacha1 CreditAttribution: mariacha1 commentedNew version of the patch that *should* apply cleanly and that fixes an issue where allowing multiple values didn't return anything.
Comment #8
mariacha1 CreditAttribution: mariacha1 commentedComment #9
mariacha1 CreditAttribution: mariacha1 commentedNew problems found when trying to allow multiple values without using the dropdown option. If the default option is still text, it should continue to be treated like a string.
Comment #10
MickL CreditAttribution: MickL commentedAny news on this? :)
Comment #11
MiroslavBanov CreditAttribution: MiroslavBanov commented@MickL
You can help move this forward by reviewing the patch.
Comment #12
MickL CreditAttribution: MickL commentedI tried the patch and yes its working fine for taxonomy terms. I'll keep you updated if i find any bugs.
(Still we need exposed filters select for content-type and fields)
Comment #13
MickL CreditAttribution: MickL commentedA very good addition to this patch would be: Choose between Select and Checkboxes for multiple selections.
Comment #14
Aron NovakFor me, setting default value did not work at all. I borrowed some code from views/handlers/views_handler_filter_in_operator.inc (views core) to make sure we set it properly.
Also i made some cosmetics.
Comment #15
EvanCo CreditAttribution: EvanCo commentedHey guys, I've applied the patch but have run into a weird issue.
After adding a selective term filter, the view results only return fields of that type. ie. if I have a selective filter for tm_vid_12_xxxx the only field returned in results is tm_vid_12_xxxx and other fields (which worked fine with and without non-selective filters) return empty values.
Any ideas what could be causing this? I'm guessing it might be another module screwing things up