I'm having issues importing configuration in staging from development to test. Workflow module has been added to the project, so it's present in devel but it's new in test environment.

I'm getting error I described at #2822866: D8 website down after upgrade (Call to a member function getPath() on null). After some debugging, I found that cache-rebuild is looking for a non-existent route name: entity.field_config.workflow_transition_field_edit_form
If I uninstall workflow module, cache-rebuild works well.

There is some conflict between the following modules:

  • enable Workflow + Workflow UI modules, do the necessary config (See comment #5)
  • enable configuration translation core module (will also enable interface translation and language modules)
  • disable workflow UI module

Comments

manuel.adan created an issue. See original summary.

johnv’s picture

johnv’s picture

Issue summary: View changes
johnv’s picture

Version: 8.x-1.x-dev » 8.x-1.0-beta5
Status: Active » Postponed (maintainer needs more info)
Related issues: +#2697031: WorkflowConfigTransitionListBuilder serves no purpose

Please try the latest dev version. The related issue 2697031 is committed.

manuel.adan’s picture

Priority: Normal » Critical
Status: Postponed (maintainer needs more info) » Active
Issue tags: +translatable fields

Re-open with detailed steps to reproduce:

  1. fresh install of drupal 8.2.4

    profile: standard, language: English
  2. enable configuration translation core module

    will also enable interface translation and language modules
  3. download and install workflow 8.x-1.0-beta6
  4. enable workflow and workflow_ui
  5. create a test workflow

    at /admin/config/workflow/workflow/add with default configuration
  6. add some states, like progress / done

    at /admin/config/workflow/workflow/test/states
  7. define some transions, eg. to author

    at /admin/config/workflow/workflow/test/transition_roles
  8. create a workflow state field for the Test workflow on page content type

    at /admin/structure/types/manage/page/fields/add-field
  9. try to uninstall the workflow_ui module (not the main workflow module)

    at /admin/modules/uninstall

you'll get "The website encountered an unexpected error. Please try again later."

Message on logs:

Error: Call to a member function getPath() on null in /var/www/html/core/modules/config_translation/src/ConfigNamesMapper.php on line 233



Backtrace:

Error: Call to a member function getPath() on null in /var/www/html/core/modules/config_translation/src/ConfigNamesMapper.php on line 233  #0 /var/www/html/core/modules/config_translation/src/Routing/RouteSubscriber.php(39): Drupal\config_translation\ConfigNamesMapper->getOverviewRoute() 
  #1 /var/www/html/core/lib/Drupal/Core/Routing/RouteSubscriberBase.php(37): Drupal\config_translation\Routing\RouteSubscriber->alterRoutes(Object(Symfony\Component\Routing\RouteCollection)) 
  #2 /var/www/html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): Drupal\Core\Routing\RouteSubscriberBase->onAlterRoutes(Object(Drupal\Core\Routing\RouteBuildEvent), 'routing.route_a...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) 
  #3 /var/www/html/core/lib/Drupal/Core/Routing/RouteBuilder.php(184): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('routing.route_a...', Object(Drupal\Core\Routing\RouteBuildEvent)) 
  #4 /var/www/html/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild() 
  #5 /var/www/html/core/lib/Drupal/Core/Extension/ModuleInstaller.php(473): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild() 
  #6 /var/www/html/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(91): Drupal\Core\Extension\ModuleInstaller->uninstall(Array, true) 
  #7 /var/www/html/core/modules/system/src/Form/ModulesUninstallConfirmForm.php(160): Drupal\Core\ProxyClass\Extension\ModuleInstaller->uninstall(Array) 
  #8 [internal function]: Drupal\system\Form\ModulesUninstallConfirmForm->submitForm(Array, Object(Drupal\Core\Form\FormState)) 
  #9 /var/www/html/core/lib/Drupal/Core/Form/FormSubmitter.php(111): call_user_func_array(Array, Array) 
  #10 /var/www/html/core/lib/Drupal/Core/Form/FormSubmitter.php(51): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState)) 
  #11 /var/www/html/core/lib/Drupal/Core/Form/FormBuilder.php(585): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState)) 
  #12 /var/www/html/core/lib/Drupal/Core/Form/FormBuilder.php(314): Drupal\Core\Form\FormBuilder->processForm('system_modules_...', Array, Object(Drupal\Core\Form\FormState)) 
  #13 /var/www/html/core/lib/Drupal/Core/Controller/FormController.php(74): Drupal\Core\Form\FormBuilder->buildForm('system_modules_...', Object(Drupal\Core\Form\FormState)) 
  #14 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch)) 
  #15 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) 
  #16 /var/www/html/core/lib/Drupal/Core/Render/Renderer.php(574): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() 
  #17 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) 
  #18 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) 
  #19 [internal function]: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() 
  #20 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(139): call_user_func_array(Object(Closure), Array) 
  #21 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(62): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) 
  #22 /var/www/html/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
  #23 /var/www/html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
  #24 /var/www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
  #25 /var/www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
  #26 /var/www/html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
  #27 /var/www/html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
  #28 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\ 
 egotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
  #29 /var/www/html/core/lib/Drupal/Core/DrupalKernel.php(652): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
  #30 /var/www/html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))



This happen on every installation operation where workflow and related modules are involved, like configuration import in staging.

manuel.adan’s picture

Version: 8.x-1.0-beta5 » 8.x-1.0-beta6

Tested version beta6

zyyz’s picture

Yes, same error. It is not possible to enable this module (1.0-beta6) while configuration translation is enabled.

prajaankit’s picture

yes same issue with drupal8.2.6

Do you really want to continue? (y/n): y
Error: Call to a member function getPath() on null in /opt/init/dev3/versions/in itial/CMS-D8/core/modules/config_translation/src/ConfigNamesMapper.php on line 2 33 #0 /opt/init/dev3/versions/initial/CMS-D8/core/modules/config_translation/src /Routing/RouteSubscriber.php(39): Drupal\config_translation\ConfigNamesMapper->g etOverviewRoute()
#1 /opt/init/dev3/versions/initial/CMS-D8/core/lib/Drupal/Core/Routing/RouteSubs criberBase.php(37): Drupal\config_translation\Routing\RouteSubscriber->alterRout es(Object(Symfony\Component\Routing\RouteCollection))
#2 /opt/init/dev3/versions/initial/CMS-D8/core/lib/Drupal/Component/EventDispatc her/ContainerAwareEventDispatcher.php(111): Drupal\Core\Routing\RouteSubscriberB ase->onAlterRoutes(Object(Drupal\Core\Routing\RouteBuildEvent), 'routing.route_a ...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#3 /opt/init/dev3/versions/initial/CMS-D8/core/lib/Drupal/Core/Routing/RouteBuil der.php(184): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->di spatch('routing.route_a...', Object(Drupal\Core\Routing\RouteBuildEvent))
#4 /opt/init/dev3/versions/initial/CMS-D8/core/lib/Drupal/Core/ProxyClass/Routin g/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild()
#5 /opt/init/dev3/versions/initial/CMS-D8/core/lib/Drupal/Core/Extension/ModuleI nstaller.php(302): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()
#6 /opt/init/dev3/versions/initial/CMS-D8/core/lib/Drupal/Core/ProxyClass/Extens ion/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install(Arra y, true)
#7 /root/.composer/vendor/drush/drush/commands/core/drupal/environment.inc(131): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array, true)
#8 /root/.composer/vendor/drush/drush/commands/core/drupal/environment.inc(198): drush_module_install(Array)
#9 /root/.composer/vendor/drush/drush/commands/pm/pm.drush.inc(1167): drush_modu le_enable(Array)
#10 /root/.composer/vendor/drush/drush/includes/command.inc(422): drush_pm_enabl e('workflow')
#11 /root/.composer/vendor/drush/drush/includes/command.inc(231): _drush_invoke_ hooks(Array, Array)
#12 /root/.composer/vendor/drush/drush/includes/command.inc(199): drush_command( 'workflow')
#13 /root/.composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_di spatch(Array)
#14 /root/.composer/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\Ba seBoot->bootstrap_and_dispatch()
#15 /root/.composer/vendor/drush/drush/drush.php(12): drush_main()
#16 {main}
Error: Call to a member function getPath() on null in Drupal\config_translation\ ConfigNamesMapper->getOverviewRoute() (line 233 of /opt/init/dev3/versions/initi al/CMS-D8/core/modules/config_translation/src/ConfigNamesMapper.php).
Drush command terminated abnormally due to an unrecoverable error. [error]

any patch or any other way to install this module

artaphis’s picture

Workflow Transition entity depends on "entity.workflow_type.edit_form" route defined in Workflow UI.

johnv’s picture

Thanks, artaphis and manuel.adan ,
already in #5 I could see that Workflow apparently depends upon Workflow UI. That is not the purpose of having submodules. Workflow should be active in Production, and Workflow UI should only be necessary in Staging.

This is because in D6/D7, the Workflow module is broken down in submodules, to lower the overhead per page load.

Adding the dependency as in #9 is not the way to go.
I could move some code from Worklfow UI to Workflow.
And perhaps, the architecture of D8 makes the spilt of code in submodules not necessary.

Question to the public:
- Should I remove the Workflow UI submodule, and move all code into the Workflow Main module? Or would it be sufficient/better/leaner to move only the necessary code?

manuel.adan’s picture

For me, the main problem here is that this bug breaks the configuration import. This forced me to get a temporary solution, patching the core config_translation module as follows:

diff --git a/core/modules/config_translation/src/Routing/RouteSubscriber.php b/core/modules/config_translation/src/Routing/RouteSubscriber.php
index b20c13f..da8480a 100644
--- a/core/modules/config_translation/src/Routing/RouteSubscriber.php
+++ b/core/modules/config_translation/src/Routing/RouteSubscriber.php
@@ -36,6 +36,13 @@ protected function alterRoutes(RouteCollection $collection) {
     $mappers = $this->mapperManager->getMappers($collection);
 
     foreach ($mappers as $mapper) {
+      // Temporary workaround for #2823659
+      if (
+        $mapper->getBaseRouteName() == 'entity.field_config.workflow_transition_field_edit_form' || 
+        $mapper->getBaseRouteName() == 'entity.workflow_type.edit_form'
+      ) {
+        continue;
+      }
       $collection->add($mapper->getOverviewRouteName(), $mapper->getOverviewRoute());
       $collection->add($mapper->getAddRouteName(), $mapper->getAddRoute());
       $collection->add($mapper->getEditRouteName(), $mapper->getEditRoute());

*not as an attachment because this is not a patch for the workflow module.

johnv’s picture

Manuel, so you do not have the problem if workflow UI is enabled?

manuel.adan’s picture

@johnv The error occurred while importing settings using drush on a new deployment. Workflow_ui was enabled, but I suspect the workflow module was installed by the config manager before the workflow_ui to satisfy some dependencies.

johnv’s picture

Assigned: Unassigned » johnv

This should be solved by adding all functionality from workflow_ui to workflow.

johnv’s picture

@manuel.adan ,
can you add this dependency to workflow_ui also at another level, e.g., your installation profile?

[EDIT] Ah, clearly, you only need workflow_ui module in development, not in other systems.

johnv’s picture

Issue summary: View changes
manuel.adan’s picture

Another simpler scenario in which this bug occurs. Download and enable workflow_ui module for the first time. The main workflow module will be requested as a dependency. Working with drush, Drupal 8.3.7 & workflow 8.x-dev (8.x-1.0-beta6+29-dev):

# drush dl --dev workflow
Project workflow (8.x-1.x-dev) downloaded to /app/modules/workflow.                                                                                                                      [success]
Project workflow contains 7 modules: workflow_devel, workflow_ui, workflow_cleanup, workflow_access, workflowfield, workflow_operations, workflow.
# drush en workflow_ui
The following extensions will be enabled: workflow_ui, workflow
Do you really want to continue? (y/n): y
Error: Call to a member function getPath() on null in /app/core/modules/config_translation/src/ConfigNamesMapper.php on line 233 #0 /app/core/modules/config_translation/src/Routing/RouteSubscriber.php(39): Drupal\config_translation\ConfigNamesMapper->getOverviewRoute()
...
zseguin’s picture

StatusFileSize
new210 bytes

I updated the patch against latest dev.

johnv’s picture

In #2734543: Error: The "workflow_type" entity type did not specify a "add" form class. some code was moved from workflow_ui to workflow module. That should do the trick.
The proposed patch means workflow_ui must Always be enabled. that is not the purpose of having submodules.

Please download latest dev version and try again.

manuel.adan’s picture

I can confirm that the bug, as described in #17, does not exist in latest -dev (tested on 8.4.0 core):

# drush en -y workflow_ui
The following extensions will be enabled: workflow_ui, workflow
Do you really want to continue? (y/n): y
workflow was enabled successfully.                                                                                    [ok]
workflow defines the following permissions: administer workflow
workflow_ui was enabled successfully.                                                                                 [ok]
Thanks for using Workflow. To maintain workflows,                                                                     [status]
    install the Workflow UI module. To start using
    a Workflow, add a Workflow Field to your entity.
Please review which roles may 'participate in workflows'                                                              [status]

Thank's

johnv’s picture

Thanks for the fast response. Please download dev again, since i discovered and fixed an error in workflow_ui in #2796705: Route "entity.workflow_type.canonical" error prevents editing Workflow

Status: Fixed » Closed (fixed)

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

johnv’s picture

Assigned: johnv » Unassigned
johnv’s picture

Title: workflow_transition configuration field entity route missing » Route for workflow_transition configuration field entity missing