[Workflow] Make sure we do not run the next transition on an updated state#28322
Merged
fabpot merged 1 commit intosymfony:4.1from Sep 4, 2018
Merged
[Workflow] Make sure we do not run the next transition on an updated state#28322fabpot merged 1 commit intosymfony:4.1from
fabpot merged 1 commit intosymfony:4.1from
Conversation
nicolas-grekas
approved these changes
Sep 2, 2018
fabpot
approved these changes
Sep 4, 2018
11b9077 to
d9dda76
Compare
Member
|
Thank you @Nyholm. |
fabpot
added a commit
that referenced
this pull request
Sep 4, 2018
…an updated state (Nyholm) This PR was squashed before being merged into the 4.1 branch (closes #28322). Discussion ---------- [Workflow] Make sure we do not run the next transition on an updated state | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | When you have a workflow like this, where all transitions are named the same.  The current behavior on `$stateMachine->apply($object, 'next')` is that it will go to "done". It will do this because it checks the current "froms" at each iteration in the loop in `apply()`. It should check the valid transition before it actually apply them. Commits ------- d9dda76 [Workflow] Make sure we do not run the next transition on an updated state
Member
Author
|
Thank you for merging |
Contributor
|
@Nyholm thank you. I was having a problem with one of my listeners triggering twice, because of this transition: 'send' => [
'from' => [Quotation::STATUS_NEW, Quotation::STATUS_SENT],
'to' => Quotation::STATUS_SENT,
],This was the cause. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When you have a workflow like this, where all transitions are named the same.
The current behavior on
$stateMachine->apply($object, 'next')is that it will go to "done".It will do this because it checks the current "froms" at each iteration in the loop in
apply(). It should check the valid transition before it actually apply them.