- Issue created by @joachim
- 🇳🇱Netherlands ekes
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
. - 🇬🇧United Kingdom joachim
Are you using the same module that Ru is which complains about canonical templates?
I can't reproduce your problem.
- 🇳🇱Netherlands ekes
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.
- 🇬🇧United Kingdom joachim
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.
- 🇳🇱Netherlands ekes
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... - 🇳🇱Netherlands ekes
Removing the canonical link template, and changing the line in module_builder_entity_type_build() has also so far worked.
- 🇬🇧United Kingdom joachim
Thanks!
I'm not sure this fixes the original problem, so leaving open