From cbd62a17f0a6cced64ad2200e1ed1f9cf87c2f5d Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 30 Aug 2016 16:42:07 +0200 Subject: [PATCH] Set author ID on duplicate, approved ID on approval of files (#4284) Fix #4210 --- concrete/src/Entity/File/Version.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/concrete/src/Entity/File/Version.php b/concrete/src/Entity/File/Version.php index 376e7f47c76..3f9eb68fd1d 100644 --- a/concrete/src/Entity/File/Version.php +++ b/concrete/src/Entity/File/Version.php @@ -408,6 +408,10 @@ public function duplicate() $fv->fvID = $fvID; $fv->fvIsApproved = false; $fv->fvDateAdded = new \DateTime(); + $uID = (int) (new User())->getUserID(); + if ($uID !== 0) { + $fv->fvAuthorUID = $uID; + } $em->persist($fv); @@ -632,6 +636,10 @@ public function approve() } $this->fvIsApproved = true; + $uID = (int) (new User())->getUserID(); + if ($uID !== 0) { + $this->fvApproverUID = $uID; + } $this->save(); $fe = new \Concrete\Core\File\Event\FileVersion($this);