Problem/Motivation
A subtle but confusing problem in the administrative UI occurs when moving between different view modes.
If you are working with 'event' content type, sometimes you end up at this URL, for example after saving your settings:
/admin/structure/types/manage/event/display/default
If you actually click on "default" then the path changes and then there appears an underline because is-active class is on the li.tabs__tab and the tab anchor (which is how the first url *should* look)
/admin/structure/types/manage/event/display
For novice users it is not obvious that these are actually the same administrative panel.
Tagging #2186359: The "Manage display" tab label when editing an entity should be "Manage displays" (plural) instead. as related because it is another UI problem in this area.
Steps to reproduce
- Install Drupal 9.5.x
- Choose normal install profile
- Go to
/admin/structure/types/manage/article/display - Notice that the Default tab is highlighted as active
- Now visit
/admin/structure/types/manage/article/display/default - Notice that none of the tabs is highlighted as active, despite viewing the screen for the default view mode settings
Proposed resolution
Even if they have different URLs they should have the same markup.
User interface changes
There should be an underline added via is-active class is on the li.tabs__tab and the tab anchor at /admin/structure/types/manage/[contenttype]/display/default
| Comment | File | Size | Author |
|---|---|---|---|
| #36 | before-patch.png | 745.64 KB | djsagar |
| #36 | After-patch.png | 801.42 KB | djsagar |
| #35 | After adding default value.png | 160.33 KB | akhil babu |
| #28 | 2870745-28.patch | 1.68 KB | Shubham Sharma 77 |
| #28 | Before-patch.png | 261.17 KB | Shubham Sharma 77 |
Issue fork drupal-2870745
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
Comment #12
tintoI managed to reproduce this in my local Drupal 9.5 install with any content type.
Steps to reproduce:
/admin/structure/types/manage/article/display/admin/structure/types/manage/article/display/default(Adding these steps to the issue summary)
Despite that I do not know how a user ends up at
/admin/structure/types/manage/article/display/default, I agree that in either case, the tab should be marked as active.Comment #13
arunkumarkCreated patch to resolve the issue.
Comment #15
arunkumarkComment #17
rakhi soni commentedKindly review patch for version 9.5x,,
Comment #18
smustgrave commentedConfirmed the issue
Applied the patch. Needed to clear cache. But it does fix the issue
Think this will need a test case.
Comment #19
arunkumark@smustgrave thanks for reviewing the patch. If the patch is part of the core, no need for any catch clear. If we are testing manually it requires the cache clear.
Comment #20
Bushra Shaikh commentedComment #21
Bushra Shaikh commentedVerified and tested patch #13. Patch applied successfully and looks good to me.
Testing steps:
1.Go to /admin/structure/types/manage/article/display
2.Notice that the Default tab is highlighted as active
3.Now visit /admin/structure/types/manage/article/display/default
4.Notice that none of the tabs is highlighted as active, despite viewing the screen for the default view mode settings.
5.Apply patch.
6.Now visit /admin/structure/types/manage/article/display/default.
Testing Result:
1. Default tab is highlighted as active when viewing the screen for the default view mode settings.
Can be move to RTBC
Comment #22
Bushra Shaikh commentedComment #23
smustgrave commentedStill no test cases
Comment #24
Bushra Shaikh commentedComment #25
Bushra Shaikh commentedComment #26
tintoI agree with #18 that this probably needs test coverage.
Comment #27
smustgrave commentedAlso @Rakhi Soni your patch is incorrect since it's all uppercase. The tests never ran
Comment #28
Shubham Sharma 77 commentedAttached reroll patch against Drupal 9.5.x.
Fixed last patch is incorrect.
For ref sharing screenshots...
Comment #29
smustgrave commentedNo tests
Comment #33
akhil babuPatch #28 changes the url of "manage display" tab from
...../displayto..../display/defaultfor all entities.Accessing the previous manage display url (eg:
admin/structure/types/manage/article/display) will result in 404. Do we really need to update the url to fix this problem. Couldn't we use 'view_mode_name' => 'default'as the default value forentity.entity_view_display.{$entity_type_id}.view_moderoute?It will fix this isssue. I am not sure if it's the correct way. So adding that change alone in a separate MR.
Comment #35
akhil babuComment #36
djsagar commentedTested MR #35 in drupal 11.x-dev.
it's resolved issue.
Steps to reproduce:
1.Go to /admin/structure/types/manage/article/display
2.Notice that the Default tab is highlighted as active
3.Now visit /admin/structure/types/manage/article/display/default
4.Apply patch.
After Patch


Before patch
Comment #37
djsagar commentedpipeline failed moving to NW.