mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-17 06:18:44 +02:00
N°4175 - Adding a lifecycle to an existing class fails on setup (using xml version < 3.0)
This commit is contained in:
@@ -785,6 +785,12 @@ class iTopDesignFormat
|
||||
if ($oFieldsSemanticNodeList->length > 0) {
|
||||
$oSemanticNode = $oFieldsSemanticNodeList->item(0);
|
||||
} else {
|
||||
if (is_null($oPropertiesNode)) {
|
||||
// No properties node found, create it
|
||||
$oClassNode = $oXPath->query("../..", $oNode)->item(0);
|
||||
$oPropertiesNode = $oClassNode->ownerDocument->createElement("properties");
|
||||
$oClassNode->appendChild($oPropertiesNode);
|
||||
}
|
||||
$oSemanticNode = $oPropertiesNode->ownerDocument->createElement("fields_semantic");
|
||||
$oPropertiesNode->appendChild($oSemanticNode);
|
||||
}
|
||||
|
||||
@@ -28,6 +28,14 @@
|
||||
</properties>
|
||||
<lifecycle/>
|
||||
</class>
|
||||
<class id="ClassWithLifecycleNoProperties">
|
||||
<lifecycle/>
|
||||
<properties>
|
||||
<fields_semantic>
|
||||
<state_attribute>foo</state_attribute>
|
||||
</fields_semantic>
|
||||
</properties>
|
||||
</class>
|
||||
<class id="OtherClass">
|
||||
<properties>
|
||||
<style>
|
||||
|
||||
@@ -28,6 +28,11 @@
|
||||
<attribute>foo</attribute>
|
||||
</lifecycle>
|
||||
</class>
|
||||
<class id="ClassWithLifecycleNoProperties">
|
||||
<lifecycle>
|
||||
<attribute>foo</attribute>
|
||||
</lifecycle>
|
||||
</class>
|
||||
<class id="OtherClass">
|
||||
<properties>
|
||||
<icon revisionid="2" _delta="redefine">
|
||||
|
||||
Reference in New Issue
Block a user