Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit ed6e001

Browse files
committed
Repository Creation Time was overriden by parent repo when created for sharing.
1 parent 21f516a commit ed6e001

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/src/core/classes/class.Repository.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ public function createSharedChild($newLabel, $newOptions, $parentId = null, $own
178178
{
179179
$repo = new Repository(0, $newLabel, $this->accessType);
180180
$newOptions = array_merge($this->options, $newOptions);
181+
$newOptions["CREATION_TIME"] = time();
182+
if (AuthService::usersEnabled() && AuthService::getLoggedUser() != null) {
183+
$newOptions["CREATION_USER"] = AuthService::getLoggedUser()->getId();
184+
}
181185
$repo->options = $newOptions;
182186
if ($parentId == null) {
183187
$parentId = $this->getId();
@@ -197,6 +201,10 @@ public function createSharedChild($newLabel, $newOptions, $parentId = null, $own
197201
public function createTemplateChild($newLabel, $newOptions, $owner = null, $uniqueUser = null)
198202
{
199203
$repo = new Repository(0, $newLabel, $this->accessType);
204+
$newOptions["CREATION_TIME"] = time();
205+
if (AuthService::usersEnabled() && AuthService::getLoggedUser() != null) {
206+
$newOptions["CREATION_USER"] = AuthService::getLoggedUser()->getId();
207+
}
200208
$repo->options = $newOptions;
201209
$repo->setOwnerData($this->getId(), $owner, $uniqueUser);
202210
$repo->setInferOptionsFromParent(true);

0 commit comments

Comments
 (0)