Skip to content

Commit

Permalink
Set author ID on duplicate, approved ID on approval of files (#4284)
Browse files Browse the repository at this point in the history
Fix #4210
  • Loading branch information
mlocati authored and aembler committed Aug 30, 2016
1 parent 3fb28b1 commit cbd62a1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions concrete/src/Entity/File/Version.php
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit cbd62a1

Please sign in to comment.