- 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
- Merge request !12697Issue #3535332: Primary tabs order when editing a taxonomy term are reversed โ (Open) created by annmarysruthy
- ๐บ๐ธ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
### 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.