Useless exception "Error: Call to a member function getPath() on null"

Created on 26 November 2018, about 6 years ago
Updated 12 March 2023, almost 2 years ago

Problem/Motivation

When I try to install Fields UI alongside with the Configuration Translation module, I get an error:

Error: Call to a member function getPath() on null in Drupal\config_translation\ConfigNamesMapper->getOverviewRoute() (line 247 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() #1 /var/www/html/web/core/lib/Drupal/Core/Routing/RouteSubscriberBase.php(37): Drupal\config_translation\Routing\RouteSubscriber->alterRoutes(Object(Symfony\Component\Routing\RouteCollection)) #2 [internal function]: Drupal\Core\Routing\RouteSubscriberBase->onAlterRoutes(Object(Drupal\Core\Routing\RouteBuildEvent), 'routing.route_a...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #3 /var/www/html/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Drupal\Core\Routing\RouteBuildEvent), 'routing.route_a...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #4 /var/www/html/web/core/lib/Drupal/Core/Routing/RouteBuilder.php(184): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('routing.route_a...', Object(Drupal\Core\Routing\RouteBuildEvent)) #5 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild() #6 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php(322): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild() #7 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install(Array, true) #8 /var/www/html/web/core/modules/system/src/Form/ModulesListConfirmForm.php(173): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array) #9 [internal function]: Drupal\system\Form\ModulesListConfirmForm->submitForm(Array, Object(Drupal\Core\Form\FormState)) #10 /var/www/html/web/core/lib/Drupal/Core/Form/FormSubmitter.php(111): call_user_func_array(Array, Array) #11 /var/www/html/web/core/lib/Drupal/Core/Form/FormSubmitter.php(51): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState)) #12 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(589): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState)) #13 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(318): Drupal\Core\Form\FormBuilder->processForm('system_modules_...', Array, Object(Drupal\Core\Form\FormState)) #14 /var/www/html/web/core/lib/Drupal/Core/Controller/FormController.php(93): Drupal\Core\Form\FormBuilder->buildForm('system_modules_...', Object(Drupal\Core\Form\FormState)) #15 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch)) #16 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #17 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #18 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #19 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #20 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #21 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #22 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #26 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #27 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(669): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #28 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #29 {main}.

Both module installs but then cache clear command does not work, the same error appears. If I uninstall either fields_ui module or configuration translation module the error is gone.

I'm using the latest drupal 8.6.3, I have tested it on 8.5.5 and it's working normally.

Steps to reproduce

TBA

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ› Bug report
Status

Closed: duplicate

Version

10.1 โœจ

Component
Config translationย  โ†’

Last updated about 1 month ago

Created by

๐Ÿ‡ธ๐Ÿ‡ฎSlovenia nkoporec Slovenia

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    Is this reproducible with just Drupal core or does this only happen for custom entities, as I see mentioned in #18, #19 and #21?

    This needs an issue summary update that includes the steps to reproduce. Reading the patch I see that this is improving the error message when \Drupal\config_translation\ConfigMapperInterface::getBaseRoute returns a NULL. However, the docs for that method currently state that is does not return a NULL. Are the docs wrong or is the implementation wrong? I did not look any further into this.

    I then searched for duplicates and found ๐Ÿ“Œ give a clearer error when config translation can't find the routes for a config entity type Needs work , which is a later issue but with more discussion, a patch with tests and it was just reviewed by a core committer.

    Therefore, I am closing this as a duplicate and moving credit.

Production build 0.71.5 2024