From 941412a365130484a5def2e90d791f4e69b27b9a Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Wed, 25 Oct 2023 10:05:46 +0200 Subject: [PATCH] Community integration: changed default behaviour for datamodel XML nodes without _delta from 'must_exist' to 'merge' --- setup/modelfactory.class.inc.php | 2 +- .../unitary-tests/setup/ModelFactoryTest.php | 50 +++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/setup/modelfactory.class.inc.php b/setup/modelfactory.class.inc.php index acea63e85..3ef265935 100644 --- a/setup/modelfactory.class.inc.php +++ b/setup/modelfactory.class.inc.php @@ -1466,7 +1466,7 @@ EOF switch ($sAlteration) { case '': if ($oNodeClone->hasAttribute('id')) { - $oNodeClone->setAttribute('_delta', 'must_exist'); + $oNodeClone->setAttribute('_delta', 'merge'); } break; case 'added': diff --git a/tests/php-unit-tests/unitary-tests/setup/ModelFactoryTest.php b/tests/php-unit-tests/unitary-tests/setup/ModelFactoryTest.php index b5ff5a8db..aaf514ce9 100644 --- a/tests/php-unit-tests/unitary-tests/setup/ModelFactoryTest.php +++ b/tests/php-unit-tests/unitary-tests/setup/ModelFactoryTest.php @@ -678,6 +678,56 @@ XML Luke Banner +XML + ]; + $aDeltas['_delta="define_and_must_exits"'] = [ + 'sInitialXML' => << + +XML + , + 'sDeltaXML' => << +