I searched and didn't find any existing mention of this. Apologies if this is duplicate...
It'd be nice if the taxonomy submenu items generated by admin_toolbar honored the vocabulary weights, such that the links appeared in the dropdown in the same order that the vocabularies appear on /admin/structure/taxonomy. Currently, they're alphabetical (it seems).
Many of the most frequently accessed vocabularies on a site I'm building that's using admin_toolbar don't happen to live at the front of the alphabet. But, since 'T' is already late in the alphabet, 'Taxonomy' appears pretty far down the page, so its child menu only shows about the first 8 options before you run out of screen (at least on my laptop, I suppose an enormous external monitor would help). ;)
Seems natural that these links could re-use the same weights as the vocabularies themselves, given admins an intuitive mechanism to easily reorder them. Presumably, the "lightest" vocabs at /admin/structure/taxonomy would be the most important and should "float to the top" of the admin_toolbar submenu, too.
Thoughts?
Current drop-down

Example ordering of admin/structure/taxonomy

| Comment | File | Size | Author |
|---|---|---|---|
| #12 | admin_toolbar-sort-bundles-2962243-12.patch | 3.2 KB | james.williams |
| #9 | 2962243-9.patch | 2.45 KB | nikitagupta |
Comments
Comment #2
dwwAdded screenshots to the summary to demo the problem.
Comment #3
dww(whoops: restricting the width of the screenshots to not look so terrible). ;)
Comment #4
adriancidHi @dww thanks for reporting, can you use the next time the Issue Summary Template?
And yes I think that this need to be changed, I will see if I can create a patch for this in the next days, or if you can create a patch, we can review it ;-)
Comment #5
chris matthews commentedOn Drupal 8.7.7 and Admin Toolbar 8.x-1.27, the taxonomy submenu items generated by admin_toolbar do honor the vocabulary weights.
Comment #6
vredko commentedHello. After checking, i found that weight of taxonomy vocabularies not honor. On the previous screenshots we see just sorting by name and if change order vocabularies in ui - menu still the same. Patch added (apply successfully to tag 8.x-2.4)
Comment #7
rokzabukovec commentedThe patch from #6 failed to apply and I tried to reroll it but every commit I tried to revert to failed to apply the patch on. I also tried to implement the solution myself with no luck. The sorting in the ExtraLinks.php in the $bundles_ids = $content_entity_bundle_storage->getQuery()->sort('weight')->pager($max_bundle_number)->execute(); works but after that the links got rearranged again so I could easily sort them to get the desired effect.
The issue still persists. The vocabularies do not get ordered by weight in the menu. I marked it back to needs work.
Comment #8
nikitagupta commentedComment #9
nikitagupta commentedfixed the test case.
Comment #10
gaurav-mathur commentedComment #11
gaurav-mathur commentedI am Also apply the Patch #6 on on Drupal 9.4.5 and PHP 8.1.6.
The patch not work properly for me.
Refer to screenshots.
Comment #12
james.williamsVersion 2.x is no longer recommended (or supported?); here's an updated patch for version 3 which actually fixes the ordering, including ensuring the 'Add' links stay above bundles with negative weights. I haven't included an interdiff because the patch is so small, and the move from 2.x -> 3.x makes it awkward to produce one anyway. If it helps, my changes are only in ExtraLinks.php .
Comment #14
james.williamsTest unexpectedly failed once, but passed the second time! Tests are fine when I run them locally, and manual testing suggests this is fine too. I'm going to assume this was due to some unreliability in the testing system.
Comment #16
adriancidThanks