Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
- It is very difficult to use devel menu items without devel menu block.
- Sometimes developer is working with multiple themes and it is not possible to add devel menu block to all themes sidebars.
- Some themes has no sidebar like seven so there is no region to add devel menu. So during development if you want to use devel menu items there is no way you can access it.
Solutions
Use shortcut bar but it only support limited number of links in D7.- Use admin_menu home link to list all devel meun items
this is/devel/variable
link replace is with/devel
link and added devel menu items as submenu. - To quick access of devel links add default
/devel
link to navigation just like/admin/structure
link in core where a user can see all the menu items.
For solution #3 the patch is added.
Comment | File | Size | Author |
---|---|---|---|
#29 | interdiff.txt | 3.43 KB | jibran |
#29 | 1817106-29.patch | 6.76 KB | jibran |
#26 | devel.menu_.26.patch | 6.75 KB | sun |
#20 | devel_menu_links-1817106-20.patch | 1007 bytes | jibran |
#14 | devel_menu_links-1817106-14.patch | 1.01 KB | jibran |
Comments
Comment #1
pcambraI was thinking the same thing, love the idea, let's move it to D8 as that comes first
Comment #2
jibranPatch for D8.
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedThat implementation looks weird. Drupal always emits lists via markup building functions, instead of doing it on your own. But is there some reason we don' just return the same render array that our Devel block emits?
Comment #4
jibranI want to make the page same as
admin/structure
. I tried to use system_admin_menu_block_page and I ended up copying this from theme_admin_block_content. Now I have changed it to theme_item_listComment #5
salvisScreenshot please?
Comment #6
salvisOops...
Comment #7
jibranI have added
/devel
to admin paths. I think it is a logical thing to do as all other menu items are admin path.Comment #8
salvisThanks -- here they are, presumably showing the new
devel
path:Why did this not work?
We'll need a proper docblock. Don't touch the others, that's part of a pending patch.
Comment #9
jibranI have looked further in system_admin_menu_block_page and finally able to use it.
Changes made in this patch:
devel
menu item is changed to 'Devel Link'. It was 'Devel Menu Links' before.devel
menu item is now part of devel menu before it was a navigation link.Landing page is the same as shown in the above screenshots.
Comment #10
jibranIn this patch
devel_page
is gone. Simple menu item is enough to show the landing page.Landing page is the same as shown in the above screenshots.
Comment #11
moshe weitzman CreditAttribution: moshe weitzman commentedThat looks better. Is it really desireable to add this link to the devel block? Maybe this should omit
'menu_name' => 'devel',
?Comment #12
jibranWithout
'menu_name' => 'devel',
'system_admin_menu_block_page'
doesn't work properly.Comment #13
juampynr CreditAttribution: juampynr commentedLooks good. Maybe I am missing something but why don't we place the path at admin/config/development/devel_menu_items? It would make these features more easy to discover.
Comment #14
jibranI think this is not a good idea
admin/config
devel/php
,devel/reference
and etc. Why don't we havedevel
?admin/structure
foradmin/structure/block
,admin/structure/menu
and etc.I have added
'expanded' => TRUE,
todevel
menu item now devel menu block looks like this by default.I think this address the concern in #11
Comment #15
juampynr CreditAttribution: juampynr commentedOK for me then.
Maybe the question is to be addressed in another issue such as "why some callbacks are not under admin/config/devel so they are visible at the admin menu?"
Comment #16
salvisjibran has answered that already: none of these pages are configurations, except for 'Devel Settings', and someone (I don't know who) really went out of this way to manage to put that item in both places.
So this patch now causes a new top-level menu item to appear in the Development block? That looks odd and is not really what we want...
Comment #17
jibranI kind of agree to this but if this is the parent for all menu items(because it is
/devel
) it should be the part of devel menu block. It doesn't make sense to move it to navigation menu. But I think we can live with that because it is by default expanded.Any other suggestion.
Comment #18
juampynr CreditAttribution: juampynr commentedEven if it is not configuration, it is what we have and what Drupal users go and look for after installing a module (that or Structure). If every contrib module would add it's own menu tree, the top level menu bar would be a mess.
Comment #19
jibranIMHO devel menu items neither belong to
admin/config/development/devel
nor anywhere currently in admin menu items. Perhaps we can introduce new menu itemadmin/devel
just likeadmin/commerce
after enabling commerce module. But I think separate devel menu is much better approach after all development is different then administration.Comment #20
jibranre-roll
Comment #21
salvisThe same goes for
admin/config
. We don't want to provide a bad example and encourage contribs to dump non-config stuff there.I agree. The advantage of having the Development menu in a block of its own is that the block can be controlled completely independently of any other permissions (like access to the
admin
menu tree). On my dev sites Anonymous always gets access to the Development and Switch User blocks — having that stuff in the regular menu structure would be confusing.Moreover, the block can be put wherever is best (or even just possible) for any given theme, even if you have no menu. The block is an essential feature that we must not give up.
Seems like we're turning in circles. What we currently have may be the best compromise we can get within the given constraints...
Comment #22
jibranI think it is good that now we have top level menu item because now we can replace variable editor with devel in admin menu and all the devel menu items can be access from it.
Comment #23
pcambraAgreed, block should stay, but I like the idea of having a devel menu on top (that would raise awareness on devel being enabled in your current environment, it could be even in a different color) but having it configuration > Development is also ok for me.
Can we reach any agreement in adding this option? :)
Comment #24
salvisWhat do you have on top? I have Admin Menu — it puts the most important items into the Druplicon menu item.
I'm not sure we're important enough to grab a top-level menu item. It's OK when a major module that provides the bulk of the functionality of my site gives me easy access to its functionality, but I really hate it when some helper that I may use occasionally is so immodest to insist on putting itself into my face all of the time.
Can we do this as opt-in?
Comment #25
jibranRelated #1899474: Show entire devel menu rather than just 'Variable editor'
Comment #26
sunI cleaned up the link titles + descriptions.
Comment #27
jibran26: devel.menu_.26.patch queued for re-testing.
Comment #29
jibranReroll. Please can we move forward with this patch it is small feature.
Comment #30
sunThanks for taking this up again -- the proposed code changes still look good to me :)
Comment #31
salvisPlease excuse the dumb question, but where do we see the benefits of this patch?
I cannot find the Devel menu, with or without this patch. IOW, the patch does not bring us closer to the stated goal of this issue.
@sun: Please bring admin_menu back. This toy in core just does not cut it.
Comment #32
jibranPlease let me know that what work this patch needs. IMHO there is nothing to fix here. If you can't commit it then mark is won't fix. I really want this option in D7 that is why I opened up the issue and due to stupid process I have to fight a battle to push it to D8 first and then D7.
I am humbly requesting please mention the issue on which I can work on so that we can able to commit it. If not then won't fix it so that I don't have to look back to this issue again.
Comment #33
willzyx CreditAttribution: willzyx commentedClosing this issue.
For the 8.x branch I have opened #2839502: Add toolbar integration - make devel menu items more accessible
Feel free to reopen this issue for 7.x if you think that there is something that can be improved. Thanks