Skip to content

Commit

Permalink
fix: set mark schema and template before saving copied test to database
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-heinrich authored and kergomard committed Feb 17, 2025
1 parent 5a48df1 commit 6b80d7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Modules/Test/classes/class.ilObjTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4444,8 +4444,11 @@ public function cloneObject(int $target_id, int $copy_id = 0, bool $omit_tree =
$new_obj->setTmpCopyWizardCopyId($copy_id);
$this->cloneMetaData($new_obj);

$new_obj->mark_schema = clone $this->mark_schema;
$new_obj->setTemplate($this->getTemplate());
$new_obj->saveToDb();
$new_obj->addToNewsOnOnline(false, $new_obj->getObjectProperties()->getPropertyIsOnline()->getIsOnline());

$this->getMainSettingsRepository()->store(
$this->getMainSettings()->withTestId($new_obj->getTestId())
->withIntroductionSettings(
Expand All @@ -4462,9 +4465,6 @@ public function cloneObject(int $target_id, int $copy_id = 0, bool $omit_tree =
$this->getScoreSettings()->withTestId($new_obj->getTestId())
);

$new_obj->mark_schema = clone $this->mark_schema;
$new_obj->setTemplate($this->getTemplate());

// clone certificate
$pathFactory = new ilCertificatePathFactory();
$templateRepository = new ilCertificateTemplateDatabaseRepository($this->db);
Expand Down

0 comments on commit 6b80d7e

Please sign in to comment.