Problem/Motivation
In Manage Display (e.g. admin/structure/types/manage/article/display) the local tasks (view modes) are ordered based on the machine name.
If Teaser is renamed to Breezer, the order is: Default / Full content / RSS / Breezer
Proposed resolution
Sort the local tasks based on the visible name, rather than the machine name.
In the above example the order would be: Default / Breezer / Full content / RSS
This issue especially affects non-English views and custom installations with extra view modes where labels have been changed from those originally created.
| Comment | File | Size | Author |
|---|---|---|---|
| #32 | 2878211-after-patch.png | 75.74 KB | nayana_mvr |
| #32 | 2878211-before-patch.png | 75.16 KB | nayana_mvr |
| #25 | interdiff-2878211-24_25.txt | 972 bytes | anchal_gupta |
| #25 | 2878211-25.patch | 4.69 KB | anchal_gupta |
| #24 | 2878211-24.patch | 4.69 KB | lendude |
Issue fork drupal-2878211
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 2878211-order-local-tasks
changes, plain diff MR !3568
Comments
Comment #2
mfernea commentedHere is the patch. I guess it needs tests as per related issue.
Comment #3
mfernea commentedComment #4
mfernea commentedFrom my pov tests need to go inside ManageDisplayTest->testViewModeLocalTasks() but this needs to be fixed first in #2878369: Tests for local tasks in Manage Display are not correct.
Comment #5
mfernea commentedHere are the test patch and complete patch.
Comment #7
dinesh18 commentedIs it really necessary to sort the local tasks?
Comment #8
mfernea commentedWe worked on a project where we had multiple view modes available. And it got quite uncomfortable to spot the targeted one if they were not sorted.
It doesn't really help (nor hurt) when you have only few (2-4).
Comment #10
mfernea commentedHere is the updated patch against 8.5.x.
Comment #15
yonailoUpdated patch for 8.8 (without tests)
Comment #24
lendudeThis came up as a random issue in Bag Smash Triage.
Nothing is really broken here, the UI could just use a bit of improving by making the order more logical, so moving to a task.
Updated the fix, put the test back in, updated the test. No interdiff cause almost everything changed.
Comment #25
anchal_gupta commentedI have fixed CCF. Please review it
Comment #26
smustgrave commentedThis issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.
This seemed like a feature request.
Confirm the issue though by renaming teaser to breezer like the IS suggested and the order did not update
Applied the patch and cleared cache
The order now is correct.
Comment #27
lauriiiThis is a usability problem when using Drupal in other language than English. On those sites it is pretty common place to have the label appear in a different language from the machine name.
It looks like #24 is only addressing this for manage display. The same problem exists for form modes. We should fix these at one to keep the sorting consistent across these two pages.
Comment #28
lauriiiComment #31
bnjmnmMR builds from #25 and adds form mode sorting.
Comment #32
nayana_mvr commentedVerified MR!3568 and tested it on Drupal version 10.1.x. The patch works fine and I have added the before and after screenshots for reference.
Comment #33
smustgrave commentedConfirmed this for form modes similar to #26
Created 2 form modes Breezer and Teaser
Renamed Teaser to A Teaser
Verified the order updated.
Comment #35
catchThis seems like a good usability improvement, I tried to think of a simpler way to sort, but couldn't come up with one.
Committed 09b7d82 and pushed to 10.1.x. Thanks!