Procházet zdrojové kódy

Model factory: _delta = if_exists, not working with <class> nodes

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4102 a333f486-631f-4898-b8df-5754b55c2be0
romainq před 9 roky
rodič
revize
2aed519d3d
1 změnil soubory, kde provedl 11 přidání a 4 odebrání
  1. 11 4
      setup/modelfactory.class.inc.php

+ 11 - 4
setup/modelfactory.class.inc.php

@@ -415,9 +415,16 @@ class ModelFactory
 				$oTargetNode = $oTarget->GetNodeById('/itop_design/classes//class', $oSourceNode->getAttribute('id'))->item(0);
 				if (!$oTargetNode)
 				{
-					echo "Dumping target doc - looking for '".$oSourceNode->getAttribute('id')."'<br/>\n";
-					$this->oDOMDocument->firstChild->Dump();
-					throw new Exception(MFDocument::GetItopNodePath($oSourceNode).' at line '.$oSourceNode->getLineNo().": could not be found");
+					if ($sDeltaSpec === 'if_exists')
+					{
+						// Just ignore it
+					}
+					else
+					{
+						echo "Dumping target doc - looking for '".$oSourceNode->getAttribute('id')."'<br/>\n";
+						$this->oDOMDocument->firstChild->Dump();
+						throw new Exception(MFDocument::GetItopNodePath($oSourceNode).' at line '.$oSourceNode->getLineNo().": could not be found A");
+					}
 				}
 				else
 				{
@@ -1901,7 +1908,7 @@ class MFElement extends Combodo\iTop\DesignElement
 			{
 				echo "Dumping parent node<br/>\n";
 				$oContainer->Dump();
-				throw new Exception(MFDocument::GetItopNodePath($this).' at line '.$this->getLineNo().": could not be found");
+				throw new Exception(MFDocument::GetItopNodePath($this).' at line '.$this->getLineNo().": could not be found B");
 			}
 			if (!$bIfExists)
 			{