Tried to delete workflow and got the following error:

The website encountered an unexpected error. Please try again later.Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("workflow_type") to generate a URL for route "entity.workflow_state.collection". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 182 of core/lib/Drupal/Core/Routing/UrlGenerator.php).

Drupal\Core\Routing\UrlGenerator->getInternalPathFromRoute('entity.workflow_state.collection', Object, Array, Array) (Line: 293)
Drupal\Core\Routing\UrlGenerator->generateFromRoute('entity.workflow_state.collection', Array, Array, 1) (Line: 105)
Drupal\Core\Render\MetadataBubblingUrlGenerator->generateFromRoute('entity.workflow_state.collection', Array, Array, 1) (Line: 753)
Drupal\Core\Url->toString(1) (Line: 342)
Drupal\Core\Entity\Entity->Drupal\Core\Entity\{closure}('collection')
array_filter(Array, Object) (Line: 348)
Drupal\Core\Entity\Entity->uriRelationships() (Line: 93)
menu_link_content_entity_predelete(Object, 'workflow_state')
call_user_func_array('menu_link_content_entity_predelete', Array) (Line: 402)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_predelete', Array) (Line: 378)
Drupal\Core\Config\Entity\ConfigEntityStorage->invokeHook('predelete', Object) (Line: 359)
Drupal\Core\Entity\EntityStorageBase->delete(Array) (Line: 395)
Drupal\Core\Entity\Entity->delete() (Line: 154)
Drupal\workflow\Entity\Workflow->delete() (Line: 122)
Drupal\Core\Entity\EntityDeleteForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 585)
Drupal\Core\Form\FormBuilder->processForm('workflow_type_delete_form', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 664)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Comments

sassafrass created an issue. See original summary.

xcusso’s picture

Subscribing

johnv’s picture

Are you using the latest dev version, or 1.0? Please reopen the related issue of the problem still exists in the dev version.

sassafrass’s picture

Yes, I am using the dev version.

sassafrass’s picture

Status: Closed (duplicate) » Active
balazswmann’s picture

I think this is also related to configuration import. Config import throws the following error:

Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("workflow_type") to generate a URL for route "entity.workflow_state.collection". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 182 of /var/www/drupalvm/web/core/lib/Drupal/Core/Routing/UrlGenerator.php).

balazswmann’s picture

Status: Active » Needs review
StatusFileSize
new3.03 KB

Attaching a patch addressing the issue described here.

sassafrass’s picture

Thank-you for the patch. I applied the patch, which applied cleanly against the latest dev version. Unfortunately, I still get the same error when I try to delete a workflow.

anas_maw’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm patch in #7 fix the issue for me, workflow version 1.1

johnv’s picture

Title: Deleting Workflow causes error » Parameters (workflow_type) is missing to generate a URL

  • johnv committed 7a60e65 on 8.x-1.x authored by balazswmann
    Issue #2966038 by balazswmann: Parameter (workflow_type) is missing to...
johnv’s picture

Title: Parameters (workflow_type) is missing to generate a URL » Parameter (workflow_type) is missing to generate a URL
Version: 8.x-1.x-dev » 8.x-1.1
Status: Reviewed & tested by the community » Fixed

Thanks, committed.

Status: Fixed » Closed (fixed)

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

calbasi’s picture

Patch #7 is not valid against Workflow 1.5 (probably because the code was commited, wasn't it?). But, like #8, the problem removing Workflow persists.

Even reinstalling from scratch the version 1.5, in my case, because there was some config files deleted what are not by default created in a new installation, and it seems there there is the reason of the error:

| | language.content_settings.workflow_transition.moderacion_de_contenido | Delete |
| | workflow.workflow.moderacion_de_contenido | Delete |
| | workflow.transition.moderacion_de_contenido_publicado_publicado | Delete |
| | workflow.transition.moderacion_de_contenido_publicado_listo_para_publicar | Delete |
| | workflow.transition.moderacion_de_contenido_listo_para_publicar_publicado | Delete |
| | workflow.transition.moderacion_de_contenido_listo_para_publicar_listo_para_publicar | Delete |
| | workflow.transition.moderacion_de_contenido_creation_publicado | Delete |
| | workflow.transition.moderacion_de_contenido_creation_listo_para_publicar | Delete |
| | workflow.state.moderacion_de_contenido_publicado | Delete |
| | workflow.state.moderacion_de_contenido_pagado | Delete |
| | workflow.state.moderacion_de_contenido_listo_para_publicar | Delete |
| | workflow.state.moderacion_de_contenido_creation | Delete |
| | block.block.workflowtransitionform | Delete |
| | language.content_settings.workflow_scheduled_transition.workflow_scheduled_transition | Delete |
| | system.action.change_a_node_to_next_workflow_state | Delete |
| | views.view.workflow_entity_history | Delete |
| language.en | views.view.workflow_entity_history | Delete |
| language.en | block.block.workflowtransitionform | Delete |
| language.fr | views.view.workflow_entity_history

calbasi’s picture

I solved it just clearing the cache, as suggested here:

https://www.drupal.org/project/workflow/issues/2710515#comment-11112259

So, I did:

drush cr

And, then, I was able to import the config with the usual

drush config-import

calbasi’s picture

johnv’s picture

Title: Parameter (workflow_type) is missing to generate a URL » Route "entity.workflow_state.collection" error when deleting/importing a Workflow