From 51dad72a0693e04918df56d03df5724dce7f9d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Wed, 9 Nov 2016 17:43:55 +0100 Subject: [PATCH] [Workflow] Set the marking then announce enabled transition It allows to auto-apply some transition from a listener. The feature was asked here: https://twitter.com/gaetanbuellet/status/796387741420441600 And It has been implemented in userland here: https://github.com/lyrixx/SFLive-Paris2016-Workflow/tree/auto-apply --- src/Symfony/Component/Workflow/Workflow.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Workflow/Workflow.php b/src/Symfony/Component/Workflow/Workflow.php index 84cd9945d49cd..b66cc85f51d90 100644 --- a/src/Symfony/Component/Workflow/Workflow.php +++ b/src/Symfony/Component/Workflow/Workflow.php @@ -126,10 +126,10 @@ public function apply($subject, $transitionName) $this->enter($subject, $transition, $marking); - $this->announce($subject, $transition, $marking); - $this->markingStore->setMarking($subject, $marking); + $this->announce($subject, $transition, $marking); + return $marking; }