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

  1. Install Drupal 9.5.x
  2. Choose normal install profile
  3. Go to /admin/structure/types/manage/article/display
  4. Notice that the Default tab is highlighted as active
  5. Now visit /admin/structure/types/manage/article/display/default
  6. 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

Issue fork drupal-2870745

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

HongPong created an issue. See original summary.

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.

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.

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.

tinto’s picture

Issue summary: View changes
Issue tags: +Bug Smash Initiative

I managed to reproduce this in my local Drupal 9.5 install with any content type.

Steps to reproduce:

  1. Install Drupal 9.5.x
  2. Choose normal install profile
  3. Go to /admin/structure/types/manage/article/display
  4. Notice that the Default tab is highlighted as active
  5. Now visit /admin/structure/types/manage/article/display/default
  6. Notice that none of the tabs is highlighted as active, despite viewing the screen for the default view mode settings

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

arunkumark’s picture

Status: Active » Needs review
StatusFileSize
new1.68 KB

Created patch to resolve the issue.

Status: Needs review » Needs work

The last submitted patch, 13: manage-display-2870745-13.patch, failed testing. View results

arunkumark’s picture

Status: Needs work » Needs review
StatusFileSize
new1.52 KB

Status: Needs review » Needs work

The last submitted patch, 15: manage-display-2870745-15.patch, failed testing. View results

rakhi soni’s picture

Status: Needs work » Needs review
StatusFileSize
new1.69 KB

Kindly review patch for version 9.5x,,

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests
StatusFileSize
new48.34 KB
new48.44 KB

Confirmed the issue
Applied the patch. Needed to clear cache. But it does fix the issue

Think this will need a test case.

arunkumark’s picture

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

Bushra Shaikh’s picture

Assigned: Unassigned » Bushra Shaikh
Bushra Shaikh’s picture

StatusFileSize
new137.49 KB
new105.3 KB

Verified 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

Bushra Shaikh’s picture

Assigned: Bushra Shaikh » Unassigned
smustgrave’s picture

Still no test cases

Bushra Shaikh’s picture

Bushra Shaikh’s picture

StatusFileSize
new109.04 KB
new109.12 KB
tinto’s picture

I agree with #18 that this probably needs test coverage.

smustgrave’s picture

Also @Rakhi Soni your patch is incorrect since it's all uppercase. The tests never ran

Shubham Sharma 77’s picture

Status: Needs work » Needs review
StatusFileSize
new257.49 KB
new261.17 KB
new1.68 KB

Attached reroll patch against Drupal 9.5.x.
Fixed last patch is incorrect.
For ref sharing screenshots...

smustgrave’s picture

Status: Needs review » Needs work

No tests

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.

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

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Akhil Babu made their first commit to this issue’s fork.

akhil babu’s picture

Patch #28 changes the url of "manage display" tab from ...../display to ..../display/default for 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 for entity.entity_view_display.{$entity_type_id}.view_mode route?

It will fix this isssue. I am not sure if it's the correct way. So adding that change alone in a separate MR.

https://www.drupal.org/files/issues/2023-12-21/After%20adding%20default%20value.png

akhil babu’s picture

StatusFileSize
new160.33 KB
djsagar’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new801.42 KB
new745.64 KB

Tested 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
after patch
Before patch
before patch

djsagar’s picture

Status: Reviewed & tested by the community » Needs work

pipeline failed moving to NW.

pooja saraah made their first commit to this issue’s fork.
This patch includes the addition of 'active_tab' => 'default', to ensure that the "is-active" class is applied when the default view mode is being viewed.

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

dcam changed the visibility of the branch 11.x to hidden.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.