Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Workflow] apply call useless code #31582

Copy link
Copy link
Closed
@noniagriconomie

Description

@noniagriconomie
Issue body actions

Symfony version(s) affected: 3.4 LTS

Description

Workflow::apply dispatch useless events, meaning useless code execution

Note: code patched in 4.2, after a discussion with @lyrixx he recommended to me to open an issue, and then a PR

How to reproduce

Given this workflow

workflow

When the subject is in "assigned" and I call workflow->apply(subject, "confirm")

the code executes all guards due to this line to retreive transitions https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Workflow/Workflow.php#L128
even if i know whoch transition i want to apply as it is the 2nd params

In 4.2, code is ok
https://github.com/symfony/symfony/blob/4.2/src/Symfony/Component/Workflow/Workflow.php#L152

Possible Solution

Retro patch this code part from 4.2 to 3.4

Additional context

3.4 is an LTS, and i really think this is a bug as it call/exec useless code

Thank you,

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.