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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mariacha1’s picture

Status: Active » Needs review
FileSize
7.17 KB

Here's the patch in the initial comment cleaned up and rerolled for -dev.

Status: Needs review » Needs work

The last submitted patch, 1: apachesolr_views-exposed_term_dropdown-2394943-1.patch, failed testing.

mariacha1’s picture

This is weird. The patch applies at hash adfeef6 locally...

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1: apachesolr_views-exposed_term_dropdown-2394943-1.patch, failed testing.

The last submitted patch, 1807028-exposed-filters-are-only-text-fields-11.patch, failed testing.

mariacha1’s picture

New version of the patch that *should* apply cleanly and that fixes an issue where allowing multiple values didn't return anything.

mariacha1’s picture

Status: Needs work » Needs review
mariacha1’s picture

New 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.

MickL’s picture

Any news on this? :)

MiroslavBanov’s picture

@MickL

You can help move this forward by reviewing the patch.

MickL’s picture

I 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)

MickL’s picture

A very good addition to this patch would be: Choose between Select and Checkboxes for multiple selections.

Aron Novak’s picture

For 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.

EvanCo’s picture

Hey 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