mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
Compiler and co: defensive programming (computing the delta)
SVN:trunk[2047]
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user