ソースを参照

Compiler and co: defensive programming (computing the delta)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2047 a333f486-631f-4898-b8df-5754b55c2be0
romainq 13 年 前
コミット
c99a5d4a7e
1 ファイル変更6 行追加3 行削除
  1. 6 3
      setup/modelfactory.class.inc.php

+ 6 - 3
setup/modelfactory.class.inc.php

@@ -949,11 +949,14 @@ EOF
 	protected function ImportNodeAndPathDelta($oTargetDoc, $oNode)
 	{
 		// Preliminary: skip the parent if this node is organized hierarchically into the DOM
-		// The criteria to detect a hierarchy is: same tag + have an id
+		// Only class nodes are organized this way
 		$oParent = $oNode->parentNode;
-		while (($oParent instanceof DOMElement) && ($oParent->tagName == $oNode->tagName) && $oParent->hasAttribute('id'))
+		if ($oNode->tagName == 'class')
 		{
-			$oParent = $oParent->parentNode;
+			while (($oParent instanceof DOMElement) && ($oParent->tagName == $oNode->tagName) && $oParent->hasAttribute('id'))
+			{
+				$oParent = $oParent->parentNode;
+			}
 		}
 		// Recursively create the path for the parent
 		if ($oParent instanceof DOMElement)