Test for status changes before firing event. Fixes #3082

This commit is contained in:
James Brooks
2018-06-17 17:52:34 +01:00
parent 648af9fec5
commit 9accf90c32
4 changed files with 58 additions and 18 deletions
@@ -50,7 +50,9 @@ class UpdateComponentCommandHandler
$component = $command->component;
$originalStatus = $component->status;
event(new ComponentStatusWasChangedEvent($this->auth->user(), $component, $originalStatus, $command->status, $command->silent));
if ($command->status && (int) $originalStatus !== (int) $command->status) {
event(new ComponentStatusWasChangedEvent($this->auth->user(), $component, $originalStatus, $command->status, $command->silent));
}
$component->update($this->filter($command));