Details
-
Bug
-
Resolution: Fixed
-
High
-
2.4.1
-
None
-
composer show | grep workflow
ezsystems/ezplatform-workflow v1.0.1 Workflow bundle for eZ Platform Enterprise Edition
Description
It is not possible to use normal custom symfony workflows when the eZ workflow bundle is installed.
Reproduce:
- Define any workflow or state machine under framework.workflows in config.yml or equivalent.
- Try to trigger a transition on the workflow
- EzSystems\EzPlatformWorkflow\Exception\NotFoundException happens
The problem is that:
- There is a separate workflow registry for eZ, which contains workflows from the eZ config and symfony has its own registry
- When calling apply, then eZ's \EzSystems\EzPlatformWorkflow\Event\Subscriber\WorkflowGuardSubscriber subsriber runs the workflow.guard event, which tries to get the workflow object from the eZ registry
- Because its not an eZ workflow, a NotFoundException is thrown by the $this->workflowRegistry->getSupportedWorkflow() call
Other subsribers may do the same, but workflow.guard is the first event and I didn't check further.
Solution:
On NotFoundException the workflow subscribers should just return and don't do anything.
Example workflow can be extracted from the official docs: https://symfony.com/doc/3.4/workflow/usage.html