diff --git a/library/Opus/Model/AbstractModel.php b/library/Opus/Model/AbstractModel.php index 8b715ebc..82bdfae2 100644 --- a/library/Opus/Model/AbstractModel.php +++ b/library/Opus/Model/AbstractModel.php @@ -440,10 +440,15 @@ public function updateFromArray($data) if ($linkModelClass !== null) { $linkModel = new $linkModelClass(); $linkModel->setModel($model); + $newModel = $model->isNewRecord(); $model = $linkModel; + if ($newModel) { + // only populate model if it is new + // TODO allow update of dependent models like licences? + $model->updateFromArray($modelValues); + } } - // $model->updateFromArray($modelValues); $models[] = $model; }