From 2f4cbcac25454ec779452bd6095063f8d723b3a2 Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Thu, 19 Apr 2012 14:37:41 +0000 Subject: [PATCH] Compiler and co: fixed issue on delta load (delete then merge a node) SVN:trunk[1964] --- setup/modelfactory.class.inc.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/setup/modelfactory.class.inc.php b/setup/modelfactory.class.inc.php index 9fc011bc55..b4e78a2d5e 100644 --- a/setup/modelfactory.class.inc.php +++ b/setup/modelfactory.class.inc.php @@ -1652,7 +1652,19 @@ class MFElement extends DOMElement public function MergeInto($oContainer, $sSearchId, $bMustExist) { $oTargetNode = $oContainer->FindExistingChildNode($this, $sSearchId); - if (!$oTargetNode) + if ($oTargetNode) + { + if ($oTargetNode->getAttribute('_alteration') == 'removed') + { + if ($bMustExist) + { + throw new Exception("XML datamodel loader: found mandatory node $this->tagName/$sSearchId marked as deleted in $oContainer->tagName"); + } + $oTargetNode = $oContainer->ownerDocument->ImportNode($this, false); + $oContainer->AddChildNode($oTargetNode); + } + } + else { if ($bMustExist) {