From e649598b4d2892c0bef9dea24cdf8f7006dc1ef1 Mon Sep 17 00:00:00 2001 From: Sebastian Blank Date: Sun, 3 Apr 2022 16:22:58 +0200 Subject: [PATCH] Fix Asset\Service::copyContents() --- models/Asset/Service.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/models/Asset/Service.php b/models/Asset/Service.php index efa1e7e88e8..6e07c8a996c 100644 --- a/models/Asset/Service.php +++ b/models/Asset/Service.php @@ -161,13 +161,12 @@ public function copyAsChild($target, $source) * @param Asset $target * @param Asset $source * - * @return mixed + * @return Asset * * @throws \Exception */ public function copyContents($target, $source) { - // check if the type is the same if (get_class($source) != get_class($target)) { throw new \Exception('Source and target have to be the same type'); @@ -179,8 +178,7 @@ public function copyContents($target, $source) } $target->setUserModification($this->_user ? $this->_user->getId() : 0); - $newProps = Element\Service::cloneMe($source->getProperties()); - $target->setProperties($newProps); + $target->setProperties($source->getProperties()); $target->save(); return $target;