From 382124a8f6927734983d597949b0ffb451ec1956 Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Thu, 4 Jul 2024 19:07:31 +0200 Subject: [PATCH] Resolve DataCollection imports from ILIAS 8.12 and lower (#7766) --- .../classes/class.ilDataCollectionDataSet.php | 7 ++++++- .../classes/class.ilDataCollectionExporter.php | 11 ++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Modules/DataCollection/classes/class.ilDataCollectionDataSet.php b/Modules/DataCollection/classes/class.ilDataCollectionDataSet.php index 62ea2fc1d42e..625a949c200f 100644 --- a/Modules/DataCollection/classes/class.ilDataCollectionDataSet.php +++ b/Modules/DataCollection/classes/class.ilDataCollectionDataSet.php @@ -85,7 +85,7 @@ public function __construct() public function getSupportedVersions(): array { - return ['4.5.0']; + return ['4.5.0', '8.13']; } /** @@ -444,6 +444,11 @@ public function importRecord( $value = null; } break; + case ilDclDatatype::INPUTFORMAT_TEXT: + if (version_compare($a_schema_version, "8.13") < 0) { + $a_rec['value'] = str_replace('<br />', '', $a_rec['value']); + } + // no break default: $value = $a_rec['value']; if ($a_entity == 'il_dcl_stloc3_value' && empty($value)) { diff --git a/Modules/DataCollection/classes/class.ilDataCollectionExporter.php b/Modules/DataCollection/classes/class.ilDataCollectionExporter.php index 2fac9c0d150a..e30d867a791b 100644 --- a/Modules/DataCollection/classes/class.ilDataCollectionExporter.php +++ b/Modules/DataCollection/classes/class.ilDataCollectionExporter.php @@ -1,4 +1,5 @@ array( 'namespace' => 'https://www.ilias.de/Modules/DataCollection/dcl/4_5', 'xsd_file" => "ilias_dcl_4_5.xsd', - 'uses_dataset' => true, 'min' => '4.5.0', + 'max' => '8.12', + ), + '8.13' => array( + 'namespace' => 'https://www.ilias.de/Modules/DataCollection/dcl/4_5', + 'xsd_file" => "ilias_dcl_4_5.xsd', + 'min' => '8.13', 'max' => '', ), );