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
The list of fields in the field mapping section of the media type form is not sorted.
Steps to reproduce
Proposed resolution
The $options should be sorted with natcasesort().
Remaining tasks
User interface changes
Before:
Click here to see the screenshots before the changes
After:
Click here to see the screenshots after the changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#8 | drupal-field-mapping-options-3251647-5.patch | 1.74 KB | dsdeiz |
| |||
#4 | drupal-field-mapping-options-3251647-3.patch | 1.69 KB | dsdeiz |
#3 | drupal-field-mapping-options-3251647-3.patch | 1.65 KB | dsdeiz |
Comments
Comment #2
phenaproximaThis will need some sort of automated test coverage.
Comment #3
dsdeiz CreditAttribution: dsdeiz at Skvare commentedYeah, would this happen to work? Patch attached.
Comment #4
dsdeiz CreditAttribution: dsdeiz at Skvare commentedComment #5
joachim CreditAttribution: joachim as a volunteer commentedYup, looks good!
Thanks for the fix, and the tests too!
Comment #6
phenaproximaComment #7
phenaproximaCouple small things:
1. To prevent fatal errors, we should also do
$this->assertGreaterThanOrEqual(3, count($options));
before asserting the text of the options.2. We should use assertSame() instead of assertEquals().
Sorry to kick it back, but otherwise this looks great to me and I would be more than happy to re-RTBC when these are fixed. :)
Comment #8
dsdeiz CreditAttribution: dsdeiz at Skvare commentedThanks! Patch attached.
Comment #9
phenaproxima❤️ Thank you! Looks great. Back to RTBC we go!
Comment #10
catchWe don't sort form items that often, would it be possible to get a before/after screenshot here?
Comment #11
joachim CreditAttribution: joachim as a volunteer commented> We don't sort form items that often, would it be possible to get a before/after screenshot here?
It's the options in the SELECT element which is a list of fields.
We definitely should present SELECT options in a way that allows users to find them easily!
Comment #12
dsdeiz CreditAttribution: dsdeiz at Skvare commentedYeah, here's the example screenshots:
* Before: https://take.ms/LEtzV
* After: https://take.ms/iWDKl
Comment #13
phenaproximaComment #15
phenaproximaUnrelated test failure.
Comment #17
phenaproximaComment #19
yogeshmpawarMarking as RTBC as test failures are unrelated.
Comment #20
quietone CreditAttribution: quietone at PreviousNext commented@dsdeiz, thanks for the screenshots but having them off d.o means they can go away. I have encountered this problem when reviewing older issues for the Bug smash initiative. Plus before and after screenshots should be in the Issue Summary so that reviewer do not have to hunt for them in comments.
Setting to NW for an issue summary update to have screenshots in the Issue Summary.
Cheers,
Comment #21
thiagoht CreditAttribution: thiagoht at CI&T commentedComment #22
thiagoht CreditAttribution: thiagoht at CI&T commentedI added the screenshots images links bellow the title User interface changes in summary as suggested by @quietone on comment #20.
Theses screenshots was related by @dsdeiz on comment #8.
Comment #24
Chris Matthews CreditAttribution: Chris Matthews commentedBack to RTBC
Comment #25
alexpottSaving issue credit.
Comment #26
alexpottCommitted and pushed b3d036aacd to 10.1.x and 3d9eaebe71 to 10.0.x and 93a3045f5b to 9.5.x. Thanks!
Sorting makes sense to me here.
Will backport to 9.4.x once the branch is unfrozen...
Comment #30
alexpottCommitted ec84527 and pushed to 9.4.x. Thanks!