Problem/Motivation
Very long WorkflowState names can lead to WorkflowTransition names that exceed the 166-character limit for config names.
[EDIT The same problem can occur with Workflow name, and WorkflowState names themselves.]
The website encountered an unexpected error. Please try again later.
Drupal\Core\Config\Entity\Exception\ConfigEntityIdLengthException: Configuration entity ID exceeds maximum allowed length of 166 characters. in Drupal\Core\Config\Entity\ConfigEntityStorage->save() (line 254 of core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php).
Drupal\Core\Entity\EntityBase->save() (Line: 609)
Drupal\Core\Config\Entity\ConfigEntityBase->save() (Line: 140)
Drupal\workflow\Entity\WorkflowConfigTransition->save() (Line: 409)
Drupal\workflow\Entity\Workflow->createTransition('', '') (Line: 105)
Drupal\workflow\Form\WorkflowConfigTransitionRoleForm->buildRow(Object) (Line: 178)
Drupal\workflow\Form\WorkflowConfigTransitionFormBase->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('workflow_config_transition_permission_form', Object) (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Steps to reproduce
- Create a workflow
- Create a workflow state that is very long
- Visit the workflow's "Transitions" tab
Proposed resolution
Truncate workflow transition configuration names that exceed 166 characters.
Remaining tasks
TBD
User interface changes
N/A
API changes
N/A
Data model changes
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | workflow-limit_config_name_length-3422048-2.patch | 1.11 KB | ergonlogic |
Comments
Comment #2
ergonlogicHere's a patch that truncates transition IDs to the maximum length for an ID supported by config storage.
Comment #3
ergonlogicComment #4
johnvThe same problem occurs when you create a Workflow with a long name.
The patch will include a fix for WorkflowTypeForm with EntityTypeInterface::BUNDLE_MAX_LENGTH .
Comment #6
johnvThe patch fixes similar problem in Workflow, State and Transition, using your code and better usage of the '#machine_name' element.