From 759b1825fe03097428052980d98da11f061e81f1 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Tue, 28 Feb 2023 13:33:47 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B05918=20-=20Fix=20activity=20panel=20disa?= =?UTF-8?q?ppearing=20when=20DoCheckToWrite=20fails?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/dbobject.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/dbobject.class.php b/core/dbobject.class.php index cb444e50b0..59049c7c24 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -2792,12 +2792,6 @@ abstract class DBObject implements iDisplay $this->DoComputeValues(); $this->OnInsert(); - if ($this->m_iKey < 0) - { - // This was a temporary "memory" key: discard it so that DBInsertSingleTable will not try to use it! - $this->m_iKey = null; - } - // If not automatically computed, then check that the key is given by the caller if (!MetaModel::IsAutoIncrementKey($sRootClass)) { @@ -2814,6 +2808,12 @@ abstract class DBObject implements iDisplay throw new CoreCannotSaveObjectException(array('issues' => $aIssues, 'class' => get_class($this), 'id' => $this->GetKey())); } + if ($this->m_iKey < 0) + { + // This was a temporary "memory" key: discard it so that DBInsertSingleTable will not try to use it! + $this->m_iKey = null; + } + // Stop watches $sState = $this->GetState(); if ($sState != '')