diff --git a/Services/Export/classes/ImportHandler/File/XML/class.ilHandler.php b/Services/Export/classes/ImportHandler/File/XML/class.ilHandler.php index f5934afda4c4..c0eeef130dd4 100644 --- a/Services/Export/classes/ImportHandler/File/XML/class.ilHandler.php +++ b/Services/Export/classes/ImportHandler/File/XML/class.ilHandler.php @@ -76,8 +76,8 @@ public function loadDomDocument(): DOMDocument $this->status->handler()->withType(StatusType::FAILED)->withContent( $this->status->content()->builder()->string()->withString( "Error loading dom document:" . - "
" . $this->getFilePath() . - "
" . $error->message + "
XML: " . $this->getSubPathToDirBeginningAtPathEnd('temp') . + "
ERROR: " . $error->message ) ) ); diff --git a/Services/Export/classes/class.ilImport.php b/Services/Export/classes/class.ilImport.php index 309836420092..532e9611d092 100644 --- a/Services/Export/classes/class.ilImport.php +++ b/Services/Export/classes/class.ilImport.php @@ -217,14 +217,19 @@ protected function validateXMLFiles(SplFileInfo $manifest_spl): ilImportStatusHa ->withFileHandler($export_file) ->getNodeInfoAt($path_to_export) ->current(); - $entity_type = $export_node_info->getValueOfAttribute('Entity'); - // type = one_two splitten - $latest_file_info = $schema_factory->getLatest($entity_type); + $types_str = $export_node_info->getValueOfAttribute('Entity'); + $types = (str_contains($types_str, '_')) + ? explode('_', $types_str) + : [$types_str]; + $latest_file_info = count($types) === 1 + ? $schema_factory->getLatest($types[0]) + : $schema_factory->getLatest($types[0], $types[1]); + $this->log->dump($types); if (is_null($latest_file_info)) { $status_collection = $status_collection->withAddedStatus($this->import_status->handler() ->withType(StatusType::DEBUG) ->withContent($this->import_status->content()->builder()->string()->withString( - 'Missing schema xsd file for entity of type: ' . $entity_type + 'Missing schema xsd file for entity of type: ' . implode('_', $types) ))); continue; } @@ -250,7 +255,7 @@ protected function checkStatus(ilImportStatusHandlerCollectionInterface $import_ if ($import_status_collection->hasStatusType(StatusType::FAILED)) { throw new ilImportException($import_status_collection ->withNumberingEnabled(true) - ->toString(StatusType::FAILED)); + ->toString(StatusType::FAILED, StatusType::DEBUG)); } }