Route "entity.workflow_state.devel_load" error InvalidParameterException with contrib Devel installed

Created on 11 April 2024, 11 months ago
Updated 29 April 2024, 10 months ago

Problem/Motivation

After creating a Workflow, cannot create states, due to following error :

Symfony\Component\Routing\Exception\InvalidParameterException: Parameter "workflow_state" for route "entity.workflow_state.devel_load" must match "[^/]++" ("" given) to generate a corresponding URL. in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 209 of C:\damp\xampp\htdocs\drupal-10\core\lib\Drupal\Core\Routing\UrlGenerator.php).

Steps to reproduce

- admin/config/workflow/workflow , create New Workflow MY_TYPE
- admin/config/workflow/workflow/MY_TYPE/states , press [Add State]. A generic error message pops up.
- admin/reports/dblog shows details in latest log message.

Proposed resolution

This happened after a change in Workflow Module, update of Devel module or Update of Drupal, since this used to work flawlessly.

The error happens upon buildOperations() of the newly created WorkflowState.
- having a newly created entity with id() is '' (empty string), gives the error "Parameter "workflow_state" for route "entity.workflow_state.devel_load" must match "[^/]++" ("" given)"
- changing the id() to NULL for the new entity gives the error "The entity cannot have a URI as it does not have an ID".

Solution is to avoid buildOperations on the new WorkflowState, to not bother core or devel module with this problem.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.7

Component

Code

Created by

🇳🇱Netherlands johnv

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024