From 3081fe2aa434a77187e5d6ee5d3dbacf3699aa90 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 24 Mar 2015 19:50:52 +1030 Subject: [PATCH] Fix DiscussionWasStarted event not being dispatched --- src/Core/Handlers/Commands/StartDiscussionCommandHandler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Core/Handlers/Commands/StartDiscussionCommandHandler.php b/src/Core/Handlers/Commands/StartDiscussionCommandHandler.php index 6ca89b786..810df4cc7 100644 --- a/src/Core/Handlers/Commands/StartDiscussionCommandHandler.php +++ b/src/Core/Handlers/Commands/StartDiscussionCommandHandler.php @@ -34,6 +34,8 @@ class StartDiscussionCommandHandler $discussion->save(); + $this->dispatchEventsFor($discussion); + // Now that the discussion has been created, we can add the first post. // For now we will do this by running the PostReply command, but as this // will trigger a domain event that is slightly semantically incorrect @@ -46,8 +48,6 @@ class StartDiscussionCommandHandler // to refresh its data. $discussion = $post->discussion; - $this->dispatchEventsFor($discussion); - return $discussion; } }