Skip to content

Commit

Permalink
Merge pull request #2513 from oat-sa/fix/AUT-3784-add-importmetadata-…
Browse files Browse the repository at this point in the history
…switch

fix: add condition for importMetadata
  • Loading branch information
Karol-Stelmaczonek authored Oct 4, 2024
2 parents caf87a2 + de73cc0 commit 3ec7eae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion models/classes/class.QtiTestService.php
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,10 @@ protected function importTest(
// Metadata will be set as property values.
$this->getMetadataImporter()->inject($qtiTestResource->getIdentifier(), $testResource);
//todo: fix taoSetup to be aware of containers. This is only workaround.
if ($this->getServiceManager()->getContainer()->has(MappedMetadataInjector::class)) {
if (
$this->getServiceManager()->getContainer()->has(MappedMetadataInjector::class)
&& $importMetadata
) {
$this->getServiceManager()->getContainer()->get(MappedMetadataInjector::class)->inject(
$mappedProperties['testProperties'] ?? [],
$metadataValues[$qtiTestResourceIdentifier] ?? [],
Expand Down

0 comments on commit 3ec7eae

Please sign in to comment.