Fix for Trac #608: install broken on PHP < 5.2.17

SVN:trunk[2481]
This commit is contained in:
Denis Flaven
2012-11-30 09:23:17 +00:00
parent b87abb7603
commit a975974fc0
2 changed files with 8 additions and 4 deletions

View File

@@ -82,7 +82,7 @@ class MFCompiler
if ($oUserRightsNode)
{
$sUserRightsModule = $oUserRightsNode->getAttribute('_created_in');
$this->Log("User Rights module foud: $sUserRightsModule");
$this->Log("User Rights module found: $sUserRightsModule");
}
// List root classes
@@ -90,7 +90,7 @@ class MFCompiler
$this->aRootClasses = array();
foreach ($this->oFactory->ListRootClasses() as $oClass)
{
$this->Log("Root class: ".$oClass->getAttribute('id'));
$this->Log("Root class (with child classes): ".$oClass->getAttribute('id'));
$this->aRootClasses[$oClass->getAttribute('id')] = $oClass;
}

View File

@@ -1686,7 +1686,9 @@ class MFElement extends DOMElement
{
throw new Exception("XML datamodel loader: found mandatory node $this->tagName/$sSearchId marked as deleted in $oContainer->tagName");
}
$oTargetNode = $oContainer->ownerDocument->ImportNode($this, false);
// Beware: ImportNode(xxx, false) DOES NOT copy the node's attribute on *some* PHP versions (<5.2.17)
// So use this workaround to import a node and its attributes on *any* PHP version
$oTargetNode = $oContainer->ownerDocument->ImportNode($this->cloneNode(false), true);
$oContainer->AddChildNode($oTargetNode);
}
}
@@ -1698,7 +1700,9 @@ class MFElement extends DOMElement
$oContainer->Dump();
throw new Exception("XML datamodel loader: could not find $this->tagName/$sSearchId in $oContainer->tagName");
}
$oTargetNode = $oContainer->ownerDocument->ImportNode($this, false);
// Beware: ImportNode(xxx, false) DOES NOT copy the node's attribute on *some* PHP versions (<5.2.17)
// So use this workaround to import a node and its attributes on *any* PHP version
$oTargetNode = $oContainer->ownerDocument->ImportNode($this->cloneNode(false), true);
$oContainer->AddChildNode($oTargetNode);
}
return $oTargetNode;