N°5906 - CRUD Event - move some code

This commit is contained in:
Eric Espie
2023-02-21 11:06:04 +01:00
parent 2d80d1c1df
commit a9f08e87f9

View File

@@ -2986,11 +2986,7 @@ abstract class DBObject implements iDisplay
// Ensure the update of the values (we are accessing the data directly)
$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;
$this->UpdateCurrentObjectInCrudStack();
}
// If not automatically computed, then check that the key is given by the caller
if (!MetaModel::IsAutoIncrementKey($sRootClass)) {
if (empty($this->m_iKey)) {
@@ -3006,6 +3002,7 @@ abstract class DBObject implements iDisplay
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;
$this->UpdateCurrentObjectInCrudStack();
}
$this->ComputeStopWatchesDeadline(true);