When uninstalling devel as part of the production check, the devel_generate module can still be enabled as it does not require devel.
If devel_generate is still enabled, this route
$this->routeName = 'devel.admin_settings';
in
Drupal\prod_check\Plugin\ProdCheck\Modules\DevelGenerate
is inaccessible once devel has been uninstalled and so when accessing the production check path
"/admin/reports/prod-check"
the following
"Symfony\Component\Routing\Exception\RouteNotFoundException devel.admin_settings does not exist" exception is thrown.

Issue fork prod_check-2921248

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Shamrockonov created an issue. See original summary.

Anybody’s picture

Happy to review patches, seems to be a bug indeed!

Anybody’s picture

Assigned: Unassigned » Grevil

Or has this already been fixed in latest versions?

Grevil’s picture

Version: 8.x-1.0-alpha3 » 8.x-1.x-dev
Grevil’s picture

Yep, this is still an issue!

Grevil’s picture

Ok, I tracked down the issue.

Inside "/src/Plugin/ProdCheck/Modules", different dev modules are tracked, which should be disabled for production use. Inside each class, an "init" method will initiate the prod_check entry, for the specific module. Since "devel_generate" doesn't have its own static route, the devel route was instead provided, leading to this error, as devel was uninstalled.

I am fairly unsure about these links in general, since they usually point to some random form of the referenced module. In my opinion, they should instead:

  1. Link to the uninstallation page of the module
  2. Link to help page of the module (if a help page is provided, otherwise there simply is no link)
  3. Or removed entirely

@Anybody, any thoughts on this?

Grevil’s picture

Status: Active » Needs review

Have a look at the MR, this approach would fix the problem for now.

Note, that I couldn't properly inject the service and my linter goes crazy with all the PHPCS issues inside this module, so it is hard to determine what the problem is.

Please review!

Anybody’s picture

Re #6: Sounds like strange and error-prune URL guessing with unclear benefit?

If yes,

Or removed entirely

is the only correct answer. Remove the link and just output the name.

Grevil’s picture

@Anybody, well, it is not quite guessing. The route is simply hard coded inside the class, see this example:

/**
 * Devel generate check
 *
 * @ProdCheck(
 *   id = "devel_generate",
 *   title = @Translation("Devel generate"),
 *   category = "modules",
 *   provider = "devel_generate"
 * )
 */
class DevelGenerate extends ModulesBase {

  /**
   * {@inheritdoc}
   */
  public function init() {
    $this->module = 'devel_generate';
    $this->routeName = 'devel.admin_settings';
  }

}
Anybody’s picture

If the benefit from this is low, it causes trouble and time to fix, remove what's not worth the time...

Grevil’s picture

@Anybody, it won't cause trouble any more, with the patch applied. Let's commit this! It might not be perfect, but putting more time in this and refactoring the link logic isn't worth it and removing the link feature is also not good, as several classes will have an unused route parameter.

Anybody’s picture

@Grevil: Then please add @todo's in all dirty parts.

Anybody’s picture

Status: Needs review » Needs work
Anybody’s picture

Status: Needs work » Reviewed & tested by the community

Thank you @Grevil! This should be refactored in total. Not worth it now, thanks for the fix and the comments!

Grevil’s picture

Status: Reviewed & tested by the community » Fixed

Glad I could help.

  • Grevil committed 36c4ed09 on 8.x-1.x
    Issue #2921248: Uninstalling Devel before devel generate results in a...

Status: Fixed » Closed (fixed)

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