- ๐บ๐ธUnited States smustgrave
This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request โ as a guide.
The issue summary should be updated with steps to reproduce. Recommend the default template as it's easier for everyone involved.
- Status changed to Needs review
almost 2 years ago 7:41am 19 February 2023 - Status changed to Needs work
almost 2 years ago 4:46pm 21 February 2023 - ๐บ๐ธUnited States smustgrave
Trying to follow the steps in the issue summary.
In Term.php I edited field_ui_base_route by adding some random text (entity.taxonomy_vocabulary.overview_formdfdasfads.
Going to the taxonomy page I get
Symfony\Component\Routing\Exception\RouteNotFoundException: Route "entity.taxonomy_term.field_ui_fields" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 206 of core/lib/Drupal/Core/Routing/RouteProvider.php).Apply the patch
Clear cache
I get the same messageMissing a step?
- Status changed to Needs review
almost 2 years ago 6:15pm 21 February 2023 - ๐ฌ๐งUnited Kingdom joachim
> In Term.php I edited field_ui_base_route by adding some random text (entity.taxonomy_vocabulary.overview_formdfdasfads.
It's config entities that this affects, sorry! Updated the IS.
- Status changed to RTBC
almost 2 years ago 3:57pm 3 March 2023 The last submitted patch, 19: 3052404-19.patch, failed testing. View results โ
- Status changed to Needs work
almost 2 years ago 7:44am 12 March 2023 - ๐ณ๐ฟNew Zealand quietone
I closed ๐ Useless exception "Error: Call to a member function getPath() on null" Closed: duplicate as a duplicate and am moving credit.
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
quietone โ credited apaderno โ .
- ๐ฉ๐ชGermany geek-merlin Freiburg, Germany
quietone โ credited geek-merlin โ .
- ๐ฌ๐งUnited Kingdom joachim
> Why isn't this also throwing an exception if $this->routeProvider->getRouteByName($name) doesn't find anything?
The check of
if (empty($route)) {
covers that case doesn't it?> Also if the current error only shows up in config_translation, this feels like it might cause an exception in some cases that currently don't have one as opposed to just replacing one fatal with another. Should it be an assert() instead of an exception?
getBaseRoute() doesn't document that it can return empty.
Code that calls is should be already assuming it's always returning a route.
- ๐จ๐ณChina qiutuo
I also reproduced the above error in another scenario,
When I use the ECK module to create the content entity type, the above error is thrown after the entity type is deleted,
After using: 3052404-21.patch the following error occurs,
Symfony\Component\Routing\Exception\RouteNotFoundException: Route "entity.field_config.weixin_field_edit_form" does not exist. in Drupal\config_translation\ConfigNamesMapper->getBaseRoute() (line 209 of core/modules/config_translation/src/ConfigNamesMapper.php).In fact, the entity type no longer exists, and the "entity.field_config.weixin_field_edit_form" route does not exist, but the prompt says that there is no such route.
- ๐จ๐ณChina qiutuo
I also reproduced the above error in another scenario,
When I use the ECK module to create the content entity type, the above error is thrown after the entity type is deleted,
After using: 3052404-21.patch the following error occurs,
Symfony\Component\Routing\Exception\RouteNotFoundException: Route "entity.field_config.weixin_field_edit_form" does not exist. in Drupal\config_translation\ConfigNamesMapper->getBaseRoute() (line 209 of core/modules/config_translation/src/ConfigNamesMapper.php).In fact, the entity type no longer exists, and the "entity.field_config.weixin_field_edit_form" route does not exist, but the prompt says that there is no such route.
- ๐ท๐บRussia niklan Russia, Perm
Hello folks, I believe that actual problem for this issue and similar to it, not in a
ConfigNameMapper
itself, but in container rebuild process. Please, take a look at ๐ Update container namespaces reference instead of hard set Needs work , because it also fixes this kind of problems.It fails on missing route because it's working with not existing entity types in
config_translation_config_translation_info()
.E.g.:
- Enable config translation module.
- Enable any module which provides a
ConfigEntityType
withedit-form
link template. - Try to disable it.
- You will get this error, because
config_translation_config_translation_info()
works with an old list of definitions. This is because entity type manager will also receive namespace of disabled module in discovery, will find entity definition and provide links for it.
- ๐ฌ๐งUnited Kingdom joachim
@Niklan it's possible that happens, but I was getting this error with the MUCH simpler way of being stupid and forgetting to define 'field_ui_base_route' in my entity type annotation!
- ๐ท๐บRussia niklan Russia, Perm
Ah, I see. But I've got same problem with valid entity definitions (yes, multiple times with different modules), just because config translation received entity type, which is uninstalled already. This is because namespace was still presented in definitions of
EntityTypeManager
at the moment when the hook is called.If someone has the same issue as mine, you can use a temporary workaround:
/** * Implements hook_config_translation_info_alter(). */ function module_config_translation_info_alter(array &$info): void { unset($info['rdf_mapping']); }
I couldn't disable
rdf
module from core which provides a valid config entity typerdf_mapping
. So I remove it from config translation logic to simply disable it.The symptoms of this is the same:
Error: Call to a member function getPath() on null in Drupal\config_translation\ConfigNamesMapper->getOverviewRoute() (line 248 of /var/www/html/web/core/modules/config_translation/src/ConfigNamesMapper.php) #0 /var/www/html/web/core/modules/config_translation/src/Routing/RouteSubscriber.php(39): Drupal\config_translation\ConfigNamesMapper->getOverviewRoute()
But in this case problem in container rebuild process.
So it's actually very easy to reproduce in different ways. ๐ Workaround from this issue should also help with cases like mine, btw.