From efdff2df686531a58ffec5fe8d9052d09b3cc505 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Sat, 19 Nov 2016 16:57:11 +0100 Subject: [PATCH] Extract another variable --- extensions/approval/src/Listener/ApproveContent.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/extensions/approval/src/Listener/ApproveContent.php b/extensions/approval/src/Listener/ApproveContent.php index e88861f84..162b8d687 100644 --- a/extensions/approval/src/Listener/ApproveContent.php +++ b/extensions/approval/src/Listener/ApproveContent.php @@ -57,13 +57,15 @@ class ApproveContent public function approveDiscussion(PostWasApproved $event) { $post = $event->post; + $discussion = $post->discussion; - $post->discussion->refreshCommentsCount(); - $post->discussion->refreshLastPost(); + $discussion->refreshCommentsCount(); + $discussion->refreshLastPost(); if ($post->number == 1) { - $post->discussion->is_approved = true; + $discussion->is_approved = true; } - $post->discussion->save(); + + $discussion->save(); } }