- Issue created by @alieffring
- ๐บ๐ธUnited States alieffring
Adds hook_admin_toolbar_extra_links_alter()
- ๐ฉ๐ชGermany ammaletu Bonn, Germany
I would very much appreciate this addition. The ExtraLinks class unfortunately adds some links which are unncessary and duplicate, and I haven't found a built-in way to remove them.
It works with the patch #2 and a hook like this:
/**
* Implements hook_admin_toolbar_extra_links_alter().
*/
function mymodule_admin_toolbar_extra_links_alter(&$links): void {
unset($links['media_library']);
} - ๐ฉ๐ชGermany ammaletu Bonn, Germany
I guess for this to be merged we need a test, right?
- ๐ฎ๐ณIndia prashant.c Dharamshala
Prashant.c โ made their first commit to this issueโs fork.
- Status changed to Needs work
over 1 year ago 9:17am 12 December 2023 - ๐ฎ๐ณIndia prashant.c Dharamshala
Thanks @alieffring and @Ammaletu.
Pushed the code by creating a issue fork, some documentation work is required inadmin_toolbar_tools/admin_toolbar_tools.api.php
. - Status changed to Needs review
3 months ago 4:08pm 7 February 2025 - ๐ฉ๐ชGermany ammaletu Bonn, Germany
I corrected the doc block in the api file. There is currently only one test in this module, so I'll be bold here and set this to "needs review". :-)
- Status changed to Closed: won't fix
21 days ago 4:35am 19 April 2025 - ๐ซ๐ทFrance dydave
Thanks a lot everyone for raising this issue and the code contributions, it's greatly appreciated!
It would seem the initial problem:
Enable the admin_toolbar_tools submodule. It generates a bunch of links, but you can't change them.
could already be achieved by using the approach detailed in comment #3488920-2: Change the deriver class of a menu link โ , with an implementation of hook_menu_links_discovered_alter.
Could you please try the suggested approach and let us know if this could work?
For the time being, closing this issue as Won't fix, since it seems there is already a proper solution provided by Drupal Core.
Feel free to re-open the issue if you consider these changes would still be needed, we would be glad to take another look.
Please let us know if you have any questions on this comment, this issue or the project in general, we would surely be glad to help.
Thanks again for your interest in the module and all your contributions! ๐