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.

Issue fork drupal-2878211

Command icon 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:

Comments

mfernea created an issue. See original summary.

mfernea’s picture

Status: Active » Needs review
StatusFileSize
new1.68 KB

Here is the patch. I guess it needs tests as per related issue.

mfernea’s picture

Issue summary: View changes
mfernea’s picture

From 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.

mfernea’s picture

Here are the test patch and complete patch.

The last submitted patch, 5: drupal-local-tasks-order-2878211-5-tests.patch, failed testing.

dinesh18’s picture

Is it really necessary to sort the local tasks?

mfernea’s picture

We 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).

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mfernea’s picture

Here is the updated patch against 8.5.x.

The last submitted patch, 10: drupal-local-tasks-order-2878211-10-tests.patch, failed testing. View results

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

yonailo’s picture

Updated patch for 8.8 (without tests)

Status: Needs review » Needs work

The last submitted patch, 15: drupal_fieldui_local_tasks_order-2878211.patch, failed testing. View results

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

lendude’s picture

Category: Bug report » Task
Status: Needs work » Needs review
Issue tags: +Bug Smash Initiative
StatusFileSize
new3 KB
new4.69 KB

This 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.

anchal_gupta’s picture

StatusFileSize
new4.69 KB
new972 bytes

I have fixed CCF. Please review it

smustgrave’s picture

Category: Task » Feature request
Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

This 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.

lauriii’s picture

Title: Manage display - Order local tasks (view modes) on name rather than machine name » Order local tasks for view modes and form modes on name rather than machine name
Category: Feature request » Bug report
Status: Reviewed & tested by the community » Needs work
Issue tags: +Usability

This 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.

lauriii’s picture

Issue tags: +Field UX

bnjmnm made their first commit to this issue’s fork.

bnjmnm’s picture

Status: Needs work » Needs review

MR builds from #25 and adds form mode sorting.

nayana_mvr’s picture

StatusFileSize
new75.16 KB
new75.74 KB

Verified 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.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed this for form modes similar to #26
Created 2 form modes Breezer and Teaser
Renamed Teaser to A Teaser
Verified the order updated.

  • catch committed 09b7d821 on 10.1.x
    Issue #2878211 by mfernea, bnjmnm, Lendude, Anchal_gupta, smustgrave,...
catch’s picture

Status: Reviewed & tested by the community » Fixed

This 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!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.