Closed (fixed)
Project:
Admin Toolbar
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 May 2016 at 14:06 UTC
Updated:
26 Nov 2017 at 15:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
eme commentedContent > media does not seem to come from core, does it ?
Comment #3
dunebl@eme: No, "Content > media" doesn't come from core, but I was thinking that the behavior of this module was inline with the D7 version in which the menu items are auto-discovered. I am sorry if I made a mistake.
Comment #4
dunebl@eme: Just to add that
Taxonomy > {Voc Name} > Listdo come from coreComment #5
eme commentedAbout taxonomy, see #2518202: Change default link to taxonomy.
Comment #6
romainj commentedI think that what we face here is that tab links are not auto-generated as menu links with Admin Toolbar Extra Tools. That would be nice but it needs a deeper interaction between tab and menu links. Drupal has a strict separation of concern between the two.
Still that's not something that is impossible but it needs quite a lot of work. We should think at it as a future feature as this issue suggests.
Comment #7
duneblI have made a patch which is adding the local tasks to the already stored links.
There are few problem with this patch:
-2 or 3 links are duplicated
-Few links are missing
But I think it is good starting point.
Comment #8
joachim commentedI'd say this is a bug, and a pretty major one at that.
Patch works for me, looking at the Content menu, but it needs some work with formatting, and also #7 says that there are some functional problems with it.
Eg:
Should be FALSE in caps, and need space both side of = (here and in other places too).
Comment #9
kbasarab commentedI wasn't able to get this to work when I installed but did cleanup a lot of the basic code style issues. One note we should try to look at here is we are 6 layers deep in if statements and indention on the patch. Wondering if we can clean this up any or execute this without looping through all existing links in the menu system.
Also setting back to feature request as even though this was in D7 version it hasn't been part of D8 which isn't a bug as it isn't existing functionality. Many modules going from D7 to D8 lost or changed functionality.
Comment #10
zerolab commentedComment #11
joachim commentedWithin a foreach loop, an alternative pattern to lots of nested ifs is to line them up in sequence and bail the loop with continue:
I tend to prefer that, as I find it more readable.
Comment #12
stefan.r commentedComment #13
berdirThis is nice, seems to work well here on a pretty big site with lots of modules.
I think quite a few other hardcoded local tasks could be removed in favor of the generic solution. Especially if it would include local actions as well, which could be a separate issue. But that too could be a follow-up.
Comment #14
duneblOn 8.4, patch #12apply with an offset:
... and the site is crashing after applying it:
Comment #15
joachim commentedThe problem was that we were adding this to the array early on in the loop:
and then sometimes bailing on the iteration, and so leaving a malformed link.
Here's an updated patch, with a few other tweaks too.
Comment #16
dunebl#15 is a marvellous step forward!!!
Many thanks joachim.
There are still few blank links (see my screenshot)
Those seems to be local tasks of type "Translate XXX settings" (maybe coming from the "Configuration Translation" module [config_translation])
Comment #17
adriancidHaving the media module installed I have the following error:
And see the pictures for other problems:
Comment #18
berdir@adriancid: That error sounds like it is related to the file_entity module, are you using both file_entity and media? that doesn't sound like a good idea. I think that should be investigated, but I actually can't reproduce that file_entity enabled and I also don't see those menu links added in the wrong place anymore.
A client reported that this was adding additonal menu links to e.g. edit terms into non-admin menus, I think they don't belong there, so I added a check to ignore all non-admin menu links, I don't think that admin_toolbar should mess with those other menus. If someone thinks there is a use case for that, it could be made configurable, but that's IMHO quite likely to mess up public menus and a bad idea.
It should also be possible to add a similar check to prevent creating empty menu links.
Comment #20
adriancidComment #21
adriancidComment #22
adriancidThanks to @all, this is a great improvement to the module!
Thanks @Berdir for the fix, and yes I have the two modules you mentioned because is a test site with a lots of module inside, and usually I install and keep the module in the site, when the site crash, I install a fresh one to start again adding modules to test :-)
Comment #23
mikejw commentedI get a similar error to @adriancid with the workflow module installed. Changing line 599 to:
if (!empty($link['parent']) && isset($links[$link['parent']])) {fixes it for me... I will create another issue around this.Comment #24
adriancid