Problem/Motivation

> Symfony\Component\Routing\Exception\RouteNotFoundException: Route "entity.module_builder_module.canonical" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 208 of core/lib/Drupal/Core/Routing/RouteProvider.php).

The item shouldn't be shown in the form in the first place.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

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:

Comments

joachim created an issue. See original summary.

ekes’s picture

I'm getting this on a new module at the moment.

I note there is a canonical link template:
https://git.drupalcode.org/project/module_builder/-/blob/4.0.x/src/Entit...

But there isn't a view_builder handler:
https://git.drupalcode.org/project/module_builder/-/blob/4.0.x/src/Entit...

Both of which are required to build the route in the inherited route_provider.

joachim’s picture

Are you using the same module that Ru is which complains about canonical templates?

I can't reproduce your problem.

ekes’s picture

Which module is that? Could be. It's a council's website.

I just installed Module Builder, to generate, a new module and a couple of plugins, but this time I'm not getting past submitting the new module from. Removing the link template, the form submits, but then just leads me to a whole other set of errors however.

joachim’s picture

Yeah, module_builder_entity_type_build() expects to find it, because it dynamically adds further templates and needs a base URL.

Ru had some module which was crashing when config entities had a canonical template.

Try changing it to 'edit-form' in module_builder_entity_type_build(), since that has the same path.

ekes’s picture

FWIW I just had a quick look at media entity (which also sometimes has canonical the same path as edit-form) it does still have a view builder defined in the handlers... ah that's for the case where it does have a standalone url. In the other cases the route_provider class returns the edit form route for the canonical route: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/media...

ekes’s picture

Removing the canonical link template, and changing the line in module_builder_entity_type_build() has also so far worked.

  • joachim committed df68ae8d on 4.0.x authored by ekes
    Issue #3478075: Remove the canonical link template.
    
    The link template...
joachim’s picture

Thanks!

I'm not sure this fixes the original problem, so leaving open

joachim’s picture

Status: Active » Fixed

It no longer crashes - there's a form validation error.

But I've added disabling of the radios for existing modules + a description with a link.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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