Skip to content

[Workflow] BC break after removing workflow.definition tag #32155

@nikossvnk

Description

@nikossvnk

Symfony version(s) affected: 4.3.*

Description
with this change [Workflow] Move code from ValidateWorkflowsPass to the FrameworkExten… · symfony/symfony@a608797 · GitHub workflow services are not tagged anymore with workflow.definition

This causes a BC break in case someone was using this tag to fetch these services during compiler pass.

How to reproduce
For example, in my case I had something like:

class MyStateMachinePass implements CompilerPassInterface
{
    public function process(ContainerBuilder $container)
    {
        foreach ($container->findTaggedServiceIds('workflow.definition') as $id => $service) {
            $workflowDefinition = $container->getDefinition($id);
            $initialState = $workflowDefinition->getArgument(2);

            // do whatever
        }
    }
}

which now is broken

Possible Solution
add again the workflow.definition tag in FrameworkExtension class line 655

            $definitionDefinition->addTag('workflow.definition', [
                'name' => $name,
                'type' => $type,
                'marking_store' => $workflow['marking_store']['type'] ?? null,
            ]);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions