Skip to content

Commit

Permalink
Merge pull request #2541 from oat-sa/bugfix/AUT-3992-no-metadata-import
Browse files Browse the repository at this point in the history
fix: handle import of props without metadata
  • Loading branch information
Karol-Stelmaczonek authored Dec 6, 2024
2 parents ba5a68e + 0984101 commit 60ac410
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion models/classes/class.QtiTestService.php
Original file line number Diff line number Diff line change
Expand Up @@ -1535,8 +1535,19 @@ private function getMappedProperties(
if ($importMetadata === true) {
$metaMetadataValues = $this->getMetaMetadataExtractor()->extract($domManifest);
$reportCtx->metaMetadata = $metaMetadataValues;
return $this->getMetaMetadataImporter()

$mappedMetadataValues = $this->getMetaMetadataImporter()
->mapMetaMetadataToProperties($metaMetadataValues, $targetItemClass, $testClass);

if (empty($mappedMetadataValues)) {
$metadataValues = $this->getMetadataImporter()->extract($domManifest);
$mappedMetadataValues = $this->getMetaMetadataImporter()->mapMetadataToProperties(
$metadataValues,
$targetItemClass,
$testClass
);
}
return $mappedMetadataValues;
}

return [];
Expand Down

0 comments on commit 60ac410

Please sign in to comment.