Fix #802 : Edit subdefs target devices

This commit is contained in:
Romain Neutron
2012-07-11 15:06:34 +02:00
parent 28a4b6bd8f
commit af8da6dac9
3 changed files with 6 additions and 4 deletions

View File

@@ -261,13 +261,15 @@ class databox_subdefsStructure implements IteratorAggregate
. 'subdef[@name="' . $name . '"]'
);
$refNode = null;
if ($nodes->length > 0) {
for ($i = 0; $i < $nodes->length; $i ++ ) {
$refNode = $nodes->item($i)->nextSibling;
$dom_group->removeChild($nodes->item($i));
}
}
$dom_group->appendChild($subdef);
$dom_group->insertBefore($subdef, $refNode);
$this->databox->saveStructure($dom_struct);