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
When using the option Exposed Grouped on a views filter, there is a limitation of 20 items to sort. This is because the delta of the form is set to 10.
Proposed resolution
Make the #delta value dynamic based on the amount of items of the grouped filter.
Remaining tasks
None
User interface changes
None
API changes
None
Data model changes
Original report by YoyoS
The delta should be increased when you need to order more than 20 fields, -10 -> 10 isn't enough.
I propose to have a delta of 30 for ordering 60 fields.
Comment | File | Size | Author |
---|---|---|---|
#14 | interdiff-2667716-12-14.txt | 891 bytes | dagmar |
#14 | 2667716-14.patch | 2.28 KB | dagmar |
#13 | after-delta.png | 56.05 KB | Lendude |
#13 | before-delta.png | 82.37 KB | Lendude |
#12 | delta-for-grouped-filters-2667716-12.patch | 2.25 KB | dagmar |
Comments
Comment #2
YoyoS CreditAttribution: YoyoS commentedComment #3
swentel CreditAttribution: swentel commentedWondering if we can make it dynamic, say based on the number fields.
Comment #4
dawehnerGood idea @swentel ... at that point we should have all fields available ...
Comment #6
dagmarUpdating the issue summary to make it clear. Also providing the patch with the dynamic version.
Comment #7
dagmarComment #9
AndyD328Many thanks for the patch, it would be great to get this committed.
Comment #11
xjmWe will need automated test coverage for a bugfix for this.
Also, the existing patch fails, so should not be marked RTBC. Once it is passing and has tests, it should also have test runs queued against SQLite and Postgres.
Thanks!
Comment #12
dagmarNew patch now with tests.
Comment #13
LendudeManually tested this by adding a 4th filter option, and the delta grows with every added group.
Before:
After:
One small thing:
should use
$web_assert->waitForField('options[group_info][group_items][4][title]');
. Less random failure prone and clearer about what we are expecting to happen.Comment #14
dagmarThanks @Lendude
Comment #15
LendudeWe got a fix and some nice new coverage for a spot that can really use some.
Comment #17
lauriiiCommitted 2e02af7 and pushed to 8.4.x. Thanks!
Comment #18
lauriiiI see this as a non-disruptive bug fix and therefore this could be considered to be backported to 8.3.x.
Comment #19
xjmThe one question that crossed my mind when I read the final patch was that I had thought we had a render element that handled automatically sizing this, but @lauriii said he checked for that as well and we don't. He also said that this matches other usecases.
The other thought that crossed my mind was scalability if the count was very large (giant select elements crushing the page), but this should be taken care of automatically by the fix from #1346760: Add a scalable weight select element. (#1518182: Improve #weight select element behavior based on the number of items it turns out is still open, but out of scope here.) So we are good on that front as well.
So this patch makes sense and I think is safe/reasonable for backport to the RC. Thanks @lauriii!
Comment #21
lauriiiThanks @xjm for confirming. Committed 94d1a3b and pushed to 8.3.x.