mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
Prevent a crash when deleting objects accessed from a list of their abstract class (i.e. Select some Contacts, "delete...", select a Person, delete => crash).
SVN:trunk[2420]
This commit is contained in:
@@ -1653,10 +1653,11 @@ abstract class DBObject
|
||||
|
||||
protected function DBDeleteSingleObject()
|
||||
{
|
||||
$this->OnDelete();
|
||||
|
||||
if (!MetaModel::DBIsReadOnly())
|
||||
{
|
||||
$this->OnDelete();
|
||||
$this->RecordObjDeletion($this->m_iKey); // May cause a reload for storing history information
|
||||
|
||||
foreach(MetaModel::ListAttributeDefs(get_class($this)) as $sAttCode => $oAttDef)
|
||||
{
|
||||
if ($oAttDef->IsHierarchicalKey())
|
||||
@@ -1689,14 +1690,12 @@ abstract class DBObject
|
||||
{
|
||||
$this->DBDeleteSingleTable($sParentClass);
|
||||
}
|
||||
|
||||
$this->AfterDelete();
|
||||
|
||||
$this->m_bIsInDB = false;
|
||||
$this->m_iKey = null;
|
||||
}
|
||||
|
||||
$this->AfterDelete();
|
||||
|
||||
$this->RecordObjDeletion($this->m_iKey);
|
||||
|
||||
$this->m_bIsInDB = false;
|
||||
$this->m_iKey = null;
|
||||
}
|
||||
|
||||
// Delete an object... and guarantee data integrity
|
||||
|
||||
Reference in New Issue
Block a user