mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 00:58:48 +02:00
Merge branch 'master' into develop
# Conflicts: # core/config.class.inc.php # core/htmlsanitizer.class.inc.php # css/css-variables.scss # css/light-grey.css # datamodels/2.x/version.xml # dictionaries/zh_cn.dictionary.itop.ui.php # synchro/synchrodatasource.class.inc.php
This commit is contained in:
@@ -346,7 +346,11 @@ abstract class DBObject implements iDisplay
|
||||
$aRow = MetaModel::MakeSingleRow(get_class($this), $this->m_iKey, false /* must be found */, true /* AllowAllData */);
|
||||
if (empty($aRow))
|
||||
{
|
||||
throw new CoreException("Failed to reload object of class '".get_class($this)."', id = ".$this->m_iKey);
|
||||
$sErrorMessage = "Failed to reload object of class '".get_class($this)."', id = ".$this->m_iKey.', DBIsReadOnly = '.(int) MetaModel::DBIsReadOnly();
|
||||
|
||||
IssueLog::Error("$sErrorMessage:\n".MyHelpers::get_callstack_text(1));
|
||||
throw new CoreException("$sErrorMessage (see the log for more information)");
|
||||
|
||||
}
|
||||
$this->FromRow($aRow);
|
||||
|
||||
@@ -2878,7 +2882,17 @@ abstract class DBObject implements iDisplay
|
||||
*/
|
||||
public function DBInsert()
|
||||
{
|
||||
$this->DBInsertNoReload();
|
||||
$this->DBInsertNoReload();
|
||||
|
||||
if (MetaModel::DBIsReadOnly())
|
||||
{
|
||||
$sClass = get_class($this);
|
||||
$sErrorMessage = "Cannot Insert object of class '$sClass' because of an ongoing maintenance: the database is in ReadOnly mode";
|
||||
|
||||
IssueLog::Error("$sErrorMessage\n".MyHelpers::get_callstack_text(1));
|
||||
throw new CoreException("$sErrorMessage (see the log for more information)");
|
||||
}
|
||||
|
||||
$this->Reload();
|
||||
return $this->m_iKey;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user