Primary tabs order when editing a taxonomy term are reversed

Created on 10 July 2025, 4 days ago

Problem/Motivation

In Drupal 11.2.x-dev and 11.2.2, when viewing or editing a taxonomy term, the order of the "Editโ€ and "Deleteโ€ tabs is reversed, so the second tab now "Delete.โ€

This appears to be a change introduced in 11.2.x. In Drupal 10.5.1 and 11.1.8, when viewing or editing a taxonomy term, the second tab on the primary tabs is "Edit," the same as when editing a node in all versions.

Screenshot comparing versions attached.

This is causing problems for content editors who expect the second tab to be "Editโ€ and end up almost deleting terms when they intended to edit them.

Steps to reproduce

  1. Install Drupal 11.2.x-dev or 11.2.2.
  2. Go to Structure > Taxonomy > Tags (/admin/structure/taxonomy/manage/tags/overview).
  3. Add a new term and use "Save and go to list."
  4. Click on the new term name (or on the "Edit" button).
  5. See that the second tab is now "Delete" and "Edit" has moved to the third tab.

Proposed resolution

Restore the order of the primary tabs for editing taxonomy terms so they are the same as previous versions and the same as when editing nodes, with "Editโ€ as the second tab and "Deleteโ€ as the third tab.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

๐Ÿ› Bug report
Status

Active

Version

11.2 ๐Ÿ”ฅ

Component

taxonomy.module

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States camhoward New Hampshire, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @camhoward
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    In Drupal core changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies โ†’ . Thanks

  • Pipeline finished with Success
    4 days ago
    Total: 837s
    #544763
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States camhoward New Hampshire, USA

    @quietone -- Ah, thanks. I used 11.2.x-dev because the issue is present in 11.2.x and not in 11.1.x and I thought I should be specific. Thanks for the clarification and update.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States camhoward New Hampshire, USA

    @annmarysruthy -- Thanks for your work on this!

    I manually applied the changes in your merge request !12697 to core/modules/taxonomy/taxonomy.links.task.yml and that resulted in the tabs displaying in this order:
    Delete, View, Edit, Revisions.

    That's not quite what I was looking for. The order should be:
    View, Edit, Delete, Revisions.

    I'm guessing that means weights should be added to all of the items in core/modules/taxonomy/taxonomy.links.task.yml.

    Feeling a bit brave, since you pointed me to making changes in core/modules/taxonomy/taxonomy.links.task.yml, I tried the following:

    entity.taxonomy_term.canonical:
      title: 'View'
      route_name: entity.taxonomy_term.canonical
      base_route: entity.taxonomy_term.canonical
      weight: 0
    
    entity.taxonomy_term.edit_form:
      title: 'Edit'
      route_name: entity.taxonomy_term.edit_form
      base_route: entity.taxonomy_term.canonical
      weight: 10
    
    entity.taxonomy_term.delete_form:
      title: 'Delete'
      route_name: entity.taxonomy_term.delete_form
      base_route: entity.taxonomy_term.canonical
      weight: 20
    
    entity.taxonomy_vocabulary.overview_form:
      title: 'List'
      route_name: entity.taxonomy_vocabulary.overview_form
      base_route: entity.taxonomy_vocabulary.overview_form
      weight: 30
    
    entity.taxonomy_vocabulary.edit_form:
      title: 'Edit'
      route_name: entity.taxonomy_vocabulary.edit_form
      base_route: entity.taxonomy_vocabulary.overview_form
      weight: 40

    This puts the tabs in the right order.

    Writing this kind of code is not my area of expertise, however, so I don't know if this is the correct way to resolve this issue.

    Thanks again for your help. I set the status back to "Needs work" since the solution in the merge request did not solve the issue. I hope that's the right thing to do. I'm learning as I go.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia annmarysruthy

    Thanks for pointing that out! You're right โ€” without an explicit weight on the View tab, it was relying on the default which could shift ordering. I've added weight: 0 to entity.taxonomy_term.canonical so all the tabs under that base route now have explicit weights. The taxonomy_vocabulary.* ones are under a different base_route, so I left them as-is to avoid altering their order unnecessarily.

    Kindly re review

  • Pipeline finished with Success
    about 15 hours ago
    Total: 680s
    #546746
  • ### Reproduction
    * Confirmed the original tab order bug (View โ€บ Delete โ€บ Edit โ€บ Revisions) on 11.x-dev, clean install.

    ### Patch / MR tested
    * Applied MR !12697 locally (`core/modules/taxonomy/taxonomy.links.task.yml` changes).

    ### Results
    * Tabs now appear in the expected order: **View โ€บ Edit โ€บ Delete โ€บ Revisions**. โœ”๏ธ
    * Checked term add / edit / delete pages โ€“ no regressions.
    * Ran `phpunit` functional tests โ€“ all green.

    ### Environment
    Drupal 11.2.x, PHP 8.3, MySQL 8.0, DDEV 1.25 (Docker + WSL2).

    **Marking Status โ†’ RTBC.**

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States camhoward New Hampshire, USA

    @annmarysruthy -- Thanks again for your work on this and for your explanation; that's very helpful.

    I manually applied the changes in your revised MR !12697 to my Drupal 11.2.2 site and the tabs now display in the correct order.

    I agree with @sagarsingh24 that the status should now be RTBC. I updated the issue summary and changed the status.

    Thank you both!

  • First commit to issue fork.
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    Adjusted the empty lines to group together the related tabs/ routes (in this case there are 2x groups): this 'technique' is used in other core *.links.task.yml files in core modules including system and block.

Production build 0.71.5 2024