Problem/Motivation

The Workflows configure route is set to `workflows.overview` which isn't in `workflows.routing.yml`.

Proposed resolution

Replace the entry with `entity.workflow.collection`.

Remaining tasks

Implementation

User interface changes

The Configure link on the modules page is currently missing in 8.3.x.

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jaesin created an issue. See original summary.

Jaesin’s picture

Adding a quick patch for what this should look like.

timmillwood’s picture

Status: Active » Needs review
Issue tags: +Workflow Initiative, +Needs tests
Sam152’s picture

Here is a test which will fail and prevent this from happening in the future. It also fails right now for both the workflows configure route and the content moderation one, so we have two to clean up here.

The test also includes a patch from #2848728: Contact module has an undeclared dependency on the user module.

From the test run:

Route "workflows.overview" does not exist.
Route "content_moderation.overview"

Status: Needs review » Needs work

The last submitted patch, 4: 2848553-module-configure-routes-4.patch, failed testing.

timmillwood’s picture

Title: Replace `workflows.overview` with `entity.workflow.collection` for the configure entry in `workflows.info.yml` » Make sure all 'configure' links are valid routes
Component: content_moderation.module » routing system
Issue tags: -beginner, -Needs tests

Making this a more general issue as the test in #4 tests all modules.

It looks like Content Moderation and Workflows are the only ones that need fixing, so we can fix both and provide the test as part of this issue.

Sam152’s picture

Component: routing system » extension system

I think this is more extension system.

Sam152’s picture

Includes the fixes and a test only patch.

The last submitted patch, 8: 2848553-TEST-ONLY-valid-configure-routes-8.patch, failed testing.

dawehner’s picture

  1. +++ b/core/tests/Drupal/KernelTests/Core/Extension/ModuleConfigureRouteTest.php
    @@ -0,0 +1,75 @@
    +      $this->enableModuleWithDependencies($module);
    ...
    +  /**
    +   * Enable a module with dependencies.
    +   *
    +   * @param string $module
    +   *   A module to enable.
    +   */
    +  protected function enableModuleWithDependencies($module) {
    +    $module_info = $this->moduleInfo[$module]->info;
    +    if (!empty($module_info['dependencies'])) {
    +      foreach ($module_info['dependencies'] as $dependency) {
    +        $this->enableModuleWithDependencies($dependency);
    +      }
    +    }
    +    if (!$this->container->get('module_handler')->moduleExists($module)) {
    +      $this->enableModules([$module]);
    +    }
    +  }
    

    I'm wondering whether why we cannot use the module installer directly ... here

  2. +++ b/core/tests/Drupal/KernelTests/FileSystemModuleDiscoveryDataProviderTrait.php
    @@ -0,0 +1,30 @@
    +
    +/**
    + * A trait used in testing for providing a list of modules in a dataProvider.
    + */
    +trait FileSystemModuleDiscoveryDataProviderTrait {
    

    <3

  3. +++ b/core/tests/Drupal/KernelTests/FileSystemModuleDiscoveryDataProviderTrait.php
    @@ -0,0 +1,30 @@
    +  /**
    +   * A data provider that lists every module in core.s
    

    Here is some quick typo

Sam152’s picture

Great feedback. The module installer took about the same time locally as recursing through dependencies, so I think this is better.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Oh nice! Thank you for measuring it.

Sam152’s picture

The last submitted patch, 11: 2848553-valid-configure-routes-11-TEST_ONLY.patch, failed testing.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed a3c32eb to 8.4.x and dc7fd78 to 8.3.x. Thanks!

Really nice work! Love the new trait.

  • alexpott committed a3c32eb on 8.4.x
    Issue #2848553 by Sam152, Jaesin, dawehner: Make sure all 'configure'...

  • alexpott committed dc7fd78 on 8.3.x
    Issue #2848553 by Sam152, Jaesin, dawehner: Make sure all 'configure'...

Status: Fixed » Closed (fixed)

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