mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Bug fix: to do not try to access a DataSource while it's being deleted
SVN:1.2[1929]
This commit is contained in:
@@ -1506,11 +1506,15 @@ class SynchroReplica extends DBObject implements iDisplay
|
||||
|
||||
if (!MetaModel::DBIsReadOnly())
|
||||
{
|
||||
$oDataSource = MetaModel::GetObject('SynchroDataSource', $this->Get('sync_source_id'));
|
||||
$sTable = $oDataSource->GetDataTable();
|
||||
$oDataSource = MetaModel::GetObject('SynchroDataSource', $this->Get('sync_source_id'), false);
|
||||
if ($oDataSource)
|
||||
{
|
||||
$sTable = $oDataSource->GetDataTable();
|
||||
|
||||
$sSQL = "DELETE FROM `$sTable` WHERE id = '{$this->GetKey()}'";
|
||||
CMDBSource::Query($sSQL);
|
||||
$sSQL = "DELETE FROM `$sTable` WHERE id = '{$this->GetKey()}'";
|
||||
CMDBSource::Query($sSQL);
|
||||
}
|
||||
// else the whole datasource has probably been already deleted
|
||||
}
|
||||
|
||||
$this->AfterDelete();
|
||||
|
||||
Reference in New Issue
Block a user