Skip to content

Commit

Permalink
fix: add condition for importMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Karol-Stelmaczonek committed Oct 3, 2024
1 parent 03aab3f commit d73cfb5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion models/classes/class.QtiTestService.php
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,9 @@ 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 d73cfb5

Please sign in to comment.