Problem/Motivation
To reproduce:
- Edit "Content" view
- Add a filter on "Authored on" field
- Expose it
- Select "is between" operator
- Save view
Expected behaviour:
Newly created filter is displayed with a label and two text-fields that allow user to define range to filter on.
Actual behaviour
The two text-fields are displayed without label.
This bug is specially annoying when you have more than one such filter as it is very hard to distinguish between them.
D7 handles this on a template level, which was removed in D8.
#2455961: Exposed filter of Changed displays with label of Operator is most likely result of the same problem.
Proposed resolution
I see two potential solutions for this problem:
- Re-introduce template for views_exposed_form (which will also fix #2455961: Exposed filter of Changed displays with label of Operator)
- Make sure label appears in exposed form render array in a correct form
Remaining tasks
- agree on approach
- write patch
- write test
User interface changes
- labels are correctly displayed with exposed filters
API changes
n/a
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 2483905.JPG | 30.89 KB | chandru225 |
| #5 | 2483905_5_TEST_ONLY.patch | 1.86 KB | slashrsm |
| #5 | 2483905_5.patch | 2.58 KB | slashrsm |
| #3 | only_title.png | 60.36 KB | slashrsm |
| #3 | fieldset.png | 68.26 KB | slashrsm |
Comments
Comment #1
slashrsm commentedComment #2
dawehnerMh, that template was always really confusing for the themer, it would be great to avoid that, if possible.
That seems to be the better solution I think. I guess we "just" need to tweak the labels which are defined in
core/modules/views/src/Plugin/views/filter/NumericFilter.php:206?Comment #3
slashrsm commentedThis is how range exposed filters look at the moment:
I think we have two possible solutions for this issue:
Comment #4
slashrsm commentedDiscussed this on IRC with @dawehner and we both agreed first option is probably the way to go. Would be nice to get some feedback from @bojhan about grouping of filters though.
Comment #5
slashrsm commentedAdded test.
Comment #7
slashrsm commentedExpected result.
Comment #8
primsi commentedThe patch by itself looks ok. Tagging with something UX related, although I don't know if that's the right tag.
Comment #9
chandru225 commentedThe Ux for this issue is still breaking and i don't see a option yo select "between range" option.
Comment #11
lendudeduplicate of #2480719: Missing label and description for exposed numeric filter when using 'between' filter, fix and tests are similar. Other issue is RTBC so probably best to just stick with that one.
Comment #12
avpaderno