Support several successive renaming of the same object

SVN:trunk[1980]
This commit is contained in:
Denis Flaven
2012-05-09 09:03:13 +00:00
parent c4ffbf1798
commit d27ab4128c

View File

@@ -1595,7 +1595,15 @@ class MFElement extends DOMElement
*/
public function Rename($sId)
{
$this->setAttribute('_old_id', $this->getAttribute('id'));
$sOriginalId = $this->getAttribute('_old_id');
if ($sOriginalId == '')
{
$this->setAttribute('_old_id', $this->getAttribute('id'));
}
else if($sOriginalId == $sId)
{
$this->removeAttribute('_old_id');
}
$this->setAttribute('id', $sId);
}
}