The devel menu config is installed through dev/config/install, and uninstalled through hook_uninstall. It works nice most of the time, but Drupal doesn't know that this menu is dependent on the devel module.
This can be an issue under certain circumstances, such as a partial config import (and notably https://github.com/drush-ops/drush/issues/1820#issuecomment-178672382).
There is a Drupal answer to this problem: https://www.drupal.org/node/2404447
It has the other advantage to make the devel_uninstall() function useless.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

GaëlG created an issue. See original summary.

willzyx’s picture

GaëlG thanks for the patch! Can we add test coverage for this?

nevergone’s picture

I apply this patch and run "drush cex --skip-modules=devel". Config export contain devel.settings.yml file.

GaëlG’s picture

@nevergone: did you use this temporary fork of drush? https://github.com/gaelg/drush

nevergone’s picture

@GaëlG: Ok, it works. But user role configuration (user.role.anonymous.yml, user.role.authenticated.yml) contain devel-related permissions: access devel information, switch users.

GaëlG’s picture

That's right, but this shouldn't break anything, these permissions will be used if Devel is enabled, and ignored if it's disabled. It won't prevent Devel installation. However, you won't be able to enable Devel if devel.settings or system.menu.devel is already in the database.

nevergone’s picture

I thought, if skipped devel module in configuration export, then all devel-related config-item leave out.

GaëlG’s picture

That would be nice, but I'm not sure if it's possible and easy with D8 config management. Actually all devel-related config entities are skipped, but devel-related data into not-devel-related config entities remain.

nevergone’s picture

Status: Needs review » Reviewed & tested by the community

Ok, I agree: this is another issue. The attached patch is tested and works well! Thanks!

willzyx’s picture

Status: Reviewed & tested by the community » Needs work

@nevergone as per #2 we need test coverage for this

GaëlG’s picture

Updated patch for latest dev. Still needs test coverage.

willzyx’s picture

Added basic test coverage and an hook_update_N() for update the enforced dependencies in the existing menu config.

+
+/**
+ * Add enforced dependencies to system.menu.devel
+ */
+function devel_update_8002() {
+  $config = \Drupal::configFactory()->getEditable('system.menu.devel');
+  $dependencies = $config->get('dependencies');
+  $dependencies['enforced']['module'][] = 'devel';
+  $config->set('dependencies', $dependencies)->save(TRUE);
+}

I'm not sure if this is the best approatch suggestions are welcome :)

  • willzyx committed 2b865e3 on 8.x-1.x
    Issue #2663558 by GaëlG, willzyx: Add enforced dependency to system.menu...
willzyx’s picture

Status: Needs review » Fixed
+++ b/config/install/system.menu.devel.yml
index c30c328..b698ec7 100644
--- a/devel.install

+++ b/devel.install
@@ -30,3 +18,13 @@ function devel_update_8001() {
+  $dependencies['enforced']['module'][] = 'devel';
+  $config->set('dependencies', $dependencies)->save(TRUE);
+}
\ No newline at end of file

Fixed on commit

Committed and pushed to 8.x. Thanks

Status: Fixed » Closed (fixed)

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