Closed (fixed)
Project:
Drupal core
Version:
9.2.x-dev
Component:
responsive_image.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Jan 2020 at 16:44 UTC
Updated:
28 May 2021 at 15:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
pcate commentedComment #3
pcate commentedPatch attached. I went ahead and cleaned up some code sniffer errors I saw as well.
Comment #4
pcate commentedComment #6
kristen polThanks for the issue and patch.
The only thing in the patch that is for the issue summary is below. The rest of the changes are formatting and other unrelated fixes. Either the issue summary needs to be updated to reflect all the changes in the patch or the patch needs to be updated to only have the fix for the issue in the issue summary.
Comment #7
ravi.shankar commentedPatch #3 was not applying on Drupal 9.1.x, so I have rerolled the patch #3 on Drupal 9.1.x and I have removed unrelated fixes.
Comment #8
kristen polThanks for the update. The changes address #6.
Not sure this warrants tests but still needs manual testing.
Comment #9
kristen polMoving back to needs work as the sorting for the drop down doesn't match the sorting for Responsive Image Styles list.
Responsive image styles
Listing page
Dropdown without patch
Dropdown with patch
Comment #10
pcate commentedUpdated patch to use regular PHP array sort method. I think this should match the style list order.
Comment #11
pcate commentedForgot to test for case insensitive, the sorting of this patch should match the style list.
Comment #12
pcate commentedComment #13
kristen polThanks for the update. Marking RTBC based on:
1) Tested and now the order is the same as the Responsive Image Styles listing as expected. See screenshots.
2) Patch applies cleanly and tests pass.
3) Title & issue summary seem clear.
4)
natcasesortis used elsewhere in core code.5) Not sure tests need to be added for this as the only
natcasesortchecking I see is in one test (LanguageLocaleListTest).Comment #14
alexpottConfig entities come with built-in sorting methods.
Above this we do ]
after this we should do
and then if we add weights or some other custom sorting stuff to image styles this with get the same functionality without us having to remember about it.
Comment #15
Vidushi Mehta commentedAs mentioned by #14 added a patch for the same.
Comment #16
thallesAfter apply #15, Drupal show me the pre set before and only so show the style that I created sorted correctly, so if I doed this correctly, I think this need more work.
See:

Comment #17
thallesComment #19
rajneeshb commentedRe-rolled the #15 for 9.2.x and also fixed the issue mentioned on #16
Comment #20
thallesAfter #19 works to me:

Comment #21
thallesComment #22
alexpottThis can be removed. The initial sort works as expected. (I think).
Comment #23
kishor_kolekar commentedWorked on comment # 22
Comment #25
quietone commentedI tested this on Drupal 9.3.x and when the patch is applied the sorting at /admin/config/media/responsive-image-style and for the field formatter at admin/structure/types/manage/article/display are the same.
For all the reasons in #14, back to RTBC
Comment #27
larowlanDiscussed this with @catch w.r.t. whether we'd require a test - as per our typical policy on tests.
He agreed we don't in this specific instance, because 'it's barely a bug' 😅
Committed baa711c and pushed to 9.3.x. Thanks!
Backported to 9.2
Comment #28
kristen polThanks for committing the "barely-bug". :) Should it be marked "minor" based on this?