瀏覽代碼

Model factory: handle the flag 'if_exists' when transforming XML from version 1.3 to older versions

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4076 a333f486-631f-4898-b8df-5754b55c2be0
romainq 9 年之前
父節點
當前提交
6fd631a0b5
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      setup/itopdesignformat.class.inc.php

+ 9 - 0
setup/itopdesignformat.class.inc.php

@@ -519,6 +519,15 @@ class iTopDesignFormat
 			$this->LogWarning('The attribute '.self::GetItopNodePath($oNode).' is irrelevant and must be removed.');
 			$this->DeleteNode($oNode);
 		}
+
+		// Discard _delta="if_exists"
+		//
+		$oNodeList = $oXPath->query("//*[@_delta='if_exists']");
+		foreach ($oNodeList as $oNode)
+		{
+			$this->LogWarning('The flag _delta="if_exists" on '.self::GetItopNodePath($oNode).' is irrelevant and must be replaced by _delta="must_exist".');
+			$oNode->setAttribute('_delta', 'must_exist');
+		}
 	}
 
 	/**