Complete and generate the Devel menu based on the Devel Toolbar settings

Created on 25 July 2025, about 1 month ago

Problem/Motivation

Currently, the Devel menu is hardcoded in the /src/Plugin/Derivative/ToolsMenuDeriver.php file.
Some menu entries for features provided by Devel are also missing (e.g., Container Info, Routes Info, etc.)

Proposed resolution

Complete the links by adding the features provided by Devel, and use the devel.toolbar.settings configuration to add or omit the menu items.

โœจ Feature request
Status

Active

Version

1.2

Component

Code

Created by

๐Ÿ‡ซ๐Ÿ‡ทFrance rmpereira

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @rmpereira
  • Pipeline finished with Failed
    about 1 month ago
    Total: 259s
    #558525
  • Can confirm this works as advertised. Modified devel Toolbar settings, cleared caches, those same menu items appear in Tools menu under "Development."

  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    This looks great! I'm all for anything to make the module more generic. I've flagged a couple of minor PHPCS issues, and there are a couple of tests that need updating. I will review and try to get this and other issues merged over the next few days.

  • Pipeline finished with Failed
    about 1 month ago
    #561591
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance rmpereira

    I fixed the minor PHPCS issues.
    I attempted to update the tests without success. The 'Tools' menu item does not appear in the navigation bar during test execution, and I havenโ€™t managed to add it.

  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    Moving to 1.3.x.

  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    Rebased for 1.3.x.

  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    Tests need fixing up.

    Would be nice to get fixed up and included in a new release.

  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    The problem I see with this change is that the default development menu options are very much reduced from what 1.2 provides.

    Here's the current list in 1.2:

    Here it is after this change:

    I am not finding the "Devel Toolbar Settings" page shown in #5. Is it provided by another module?

    While being able to customise the options on the menu is useful, I'm sure there are other users like me who don't know this is possible.

    I can think of several solutions:

    1. Add a recommendation to the project page/README to install the module providing the Devel Toolbar settings page. I think this would be useful to do, but I would not favour as the only solution.
    2. In ToolsMenuDeriver, detect if module providing Devel Toolbar settings is enabled, and if not, add the options that 1.2 includes that the Devel module does not add by default.
    3. During Install, enable the missing options in the same way as the Devel Toolbar settings page. An update hook would also be needed for those upgrading from earlier versions.

    My preference would be option 3, as it's fairly seamless for existing users of the module.

  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    Ah! I found the route in the Devel module, and realised it has a dependency on the Toolbar module. I normally disable Toolbar when I enable Navigation, hence I was not seeing it.

    I think it would be worth opening an issue in the Devel module to get this dependency removed, or to make dependent on Toolbar OR Navigation.

    I'm still feeling the best solution is to enable a larger set of options during install.

  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    Added service to enable the previously included Devel menu items.

    Called from hook_install and hook_modules_installed, to catch devel being installed after navigation_extra_tools.

    Fixed up tests.

    Would like to add a test that covers installing navigation_extra_tools before devel, and vice versa.

    Need to add an update hook to enable options when upgrading.

    Would like to generate a fixture and add a test of the update.

  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    I have added a test that uninstalls navigation extra tools, then reinstalls it, and then does the same for the devel module.

    This tests that devel options get enabled whichever order the modules get enabled. I want to add a check for specific menu items that are enabled during install.

  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    Added checks for Config Editor menu, which will only be present if extra items enabled by Navigation Extra Tools.

    Main thing left is to add an update hook, and associated test, and then will be ready to go back to needs review.

  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    I have added an update hook to call the Devel Menu service to update the initial development menu contents to match the hard coded entries from earlier versions.

    Moving to Needs Review.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States ultimike Florida, USA

    I've left some minor comments about a few of the code comments above.

    Testing this on my local, I had version 1.2.1 installed. I checked out this MR, rebuilt caches, and ran `drush updb` and the 10001 update hook fired as expected without any issues.

    I did notice that if I made changes on /admin/config/development/devel/toolbar, I needed to rebuild caches before the changes were reflected in the menu - maybe do a form alter to rebuild caches when that form is submitted?

    Regardless, everything else looks super-solid! I'll RTBC this because nothing I found is a deal-breaker.

    -mike

  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    Although there is a minor issue that changing the options on the Devel Toolbar page requires a cache clear to take effect, I don't want to hold up a release any longer, so I will merge and create a follow up issue.

  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    Merged and will release version 1.3.0 shortly.

    Thanks @rmpereira for the initial idea and MR, and thanks to @bhogue and @ultimike for reviewing.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024