Uploaded image for project: 'eZ Platform Enterprise Edition'
  1. eZ Platform Enterprise Edition
  2. EZEE-2699

Workflow bundle breaks symfony workflows

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • 2.5.0-beta1, 2.4.2
    • 2.4.1
    • Workflow
    • 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:

      1. Define any workflow or state machine under framework.workflows in config.yml or equivalent.
      2. Try to trigger a transition on the workflow
      3. 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

      Attachments

        Activity

          People

            Unassigned Unassigned
            slaci1@gmail.com slaci1@gmail.com
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: