diff --git a/models/classes/class.QtiTestService.php b/models/classes/class.QtiTestService.php index 8df95684b..c5dc56eec 100644 --- a/models/classes/class.QtiTestService.php +++ b/models/classes/class.QtiTestService.php @@ -812,8 +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) && - $importMetadata + if ( + $this->getServiceManager()->getContainer()->has(MappedMetadataInjector::class) + && $importMetadata ) { $this->getServiceManager()->getContainer()->get(MappedMetadataInjector::class)->inject( $mappedProperties['testProperties'] ?? [],