Skip to content

Commit

Permalink
Merge pull request ILIAS-eLearning#8771 from leifos-gmbh/10_mantis_il…
Browse files Browse the repository at this point in the history
…ias_42881

Export: mantis ilias 42881
  • Loading branch information
schmitz-ilias committed Dec 20, 2024
1 parent a3777ff commit e4358fc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ protected function init(): void
$this->sv['xsd_file'] ??= '';
}

public function withExportTarget(ilExportHandlerTargetInterface $export_target): ilExportHandlerExportComponentInfoInterface
{
public function withExportTarget(
ilExportHandlerTargetInterface $export_target
): ilExportHandlerExportComponentInfoInterface {
$clone = clone $this;
$clone->export_target = $export_target;
$clone->init();
Expand Down
17 changes: 9 additions & 8 deletions components/ILIAS/Export/classes/class.ilXmlExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,17 @@ final public function determineSchemaVersion(
string $a_target_release
): array {
$svs = $this->getValidSchemaVersions($a_entity);
$found = false;
$rsv = [];
foreach ($svs as $k => $sv) {
if (!$found) {
if (version_compare($sv["min"], ILIAS_VERSION_NUMERIC, "<=")
&& ($sv["max"] == "" || version_compare($sv["max"], ILIAS_VERSION_NUMERIC, ">="))) {
$rsv = $sv;
$rsv["schema_version"] = $k;
$found = true;
}
$min_version = $sv["min"] ?? "";
$max_version = $sv["max"] ?? "";
if (
($min_version === "" || version_compare($min_version, ILIAS_VERSION_NUMERIC, "<=")) &&
($max_version === "" || version_compare($max_version, ILIAS_VERSION_NUMERIC, ">="))
) {
$rsv = $sv;
$rsv["schema_version"] = $k;
break;
}
}
return $rsv;
Expand Down
3 changes: 2 additions & 1 deletion components/ILIAS/Style/classes/class.ilStyleExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public function getValidSchemaVersions(string $a_entity): array
"namespace" => "http://www.ilias.de/Services/Style/10_0",
"xsd_file" => "ilias_style_10.xsd",
"uses_dataset" => true,
"min" => "10.0"),
"min" => "10.0",
"max" => "10.99"),
"8.0" => array(
"namespace" => "http://www.ilias.de/Services/Style/8",
"xsd_file" => "ilias_style_8.xsd",
Expand Down

0 comments on commit e4358fc

Please sign in to comment.