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.
Problem/Motivation
Initially brought up in Convert theme_views_ui_build_group_filter_form() to Twig, but deemed out of scope.
In the Grouped filters table, there is a default checkbox and radio button, only one of which is available depending on whether the mode is set to allow multiple selections or a single selection. They are properly hidden however both of their labels are always shown.
Proposed resolution
Patch attached, fixes that.
Comment | File | Size | Author |
---|---|---|---|
#9 | after.png | 21.87 KB | olli |
#9 | before.png | 23.2 KB | olli |
#9 | 2496501-9.patch | 1.54 KB | olli |
#6 | interdiff.txt | 1.59 KB | olli |
#6 | grouped-2496501-6.patch | 1.55 KB | olli |
Comments
Comment #1
NickDickinsonWildeComment #2
joelpittetThis may also fix it? #2489826: tabledrag is broken
Comment #3
olli CreditAttribution: olli commented@joelpittet: This is about the double labels when configuring a grouped filter (edit frontpage view, click "Content: Publishing status (grouped)" below filter criteria, try un/checking "Allow multiple selections").
Comment #4
joelpittet@olli ah thanks for clarifying.
Comment #5
droplet CreditAttribution: droplet commented@@ -836,13 +836,13 @@
+ $('input.default-checkboxes').parent().hide()
Missing `;`
----
Some Issues I've seen and can be fix in new threads (please pointed me to there if it's an issue opened already):
Comment #6
olli CreditAttribution: olli commentedFixed #5, thanks @droplet.
----
There's #2387353: Improve form element labels in views grouped filter for labels, not sure about the other points.
Here we want to replace checkboxes with radios when user should select only one default value, and replace radios with checkboxes to allow selecting multiple default values. What is the right way to do that?
Maybe also change the order of Default and Label columns?
I agree. Any ideas how to improve that?
Comment #7
droplet CreditAttribution: droplet commentedImprove in #6 looks good and fixing the problems.
@olli,
I have no good idea for other issues yet :)
Comment #8
alexpottI've tried to manually test this but there is quite a bit wrong with this form so it'd be great to have screenshot so I can see what this is fixing. Sorry for being dumb.
Comment #9
olli CreditAttribution: olli commentedReroll and screenshots.
Comment #10
olli CreditAttribution: olli commentedFound #2503691: Checkboxes and radios rendered twice in views ui grouped filters form while taking those screenshots.
Comment #11
alexpottCommitted 8d9f1ea and pushed to 8.0.x. Thanks!