- Issue created by @andreastkdf
- @andreastkdf opened merge request.
- πΊπΈUnited States smustgrave
Changes should be against 7.1.x or 7.0.x as those are the primary supported branches
Will need test coverage
- π¬π§United Kingdom andreastkdf
Thanks @smustgrave β ! Yes, sorry, forgot to mention that I'm still using 6.0.x and wrote and tested my patch against 6.0.x The patch in the MR may need to be rolled out for 7.0.x then.
Agreed on test coverage, not sure when I'll manage to do it so happy if anyone want to pick that out :)
- π¬π§United Kingdom andreastkdf
Ok, I've added test coverage to
tests/src/Unit/BetterExposedFiltersHelperUnitTest.php
to support the fix for the exposed filter option sorting. These new tests specifically verify:- The correct preservation of the standard "- Any -" string when it is the first option.
- Proper alphabetical sorting of options when the first item in the list is not "- Any -".
- The correct preservation of translated "- Any -" options (i.e., TranslatableMarkup objects) when they appear as the first item.
- Graceful handling of empty option arrays by the sorting logic.
- πΊπΈUnited States smustgrave
Believe the test coverage needs work, the test-only feature is passing when it should fail.
- π¬π§United Kingdom andreastkdf
thanks @smustgrave β !
Thanks for checking, my bad! my new test had nothing to do in
tests/src/Unit/BetterExposedFiltersHelperUnitTest.php
and should be done ontests/src/Kernel/Plugin/filter/FilterWidgetKernelTest.php
to acually test theprocessSortedOptions
(and notsortOptions
)tests now updated in
FilterWidgetKernelTest.php
. They now correctly targetprocessSortedOptions
(not the helpersortOptions
, which couldn't show this specific bug) and should demonstrate the required fail/pass behavior against the existing fix. -
smustgrave β
committed bcc1d9cd on 7.1.x authored by
andreastkdf β
#3520717: Fix alphabetical sorting when no "- Any -" option exists
-
smustgrave β
committed bcc1d9cd on 7.1.x authored by
andreastkdf β
- πΊπΈUnited States smustgrave
Looks good now! Hoping to get a 7.1.0 release done in a few weeks, not 100% sure about backporting to 7.0.x
-
smustgrave β
committed 5686f614 on 7.0.x
Issue #3520717 by andreastkdf, smustgrave: Alphabetical sorting...
-
smustgrave β
committed 5686f614 on 7.0.x
Automatically closed - issue fixed for 2 weeks with no activity.