Skip to content

Commit 06a5d64

Browse files
committed
N°4756 - ✅ Ease extensibility for CRUD operations : Add unit tests
1 parent 5d1852f commit 06a5d64

File tree

3 files changed

+752
-2
lines changed

3 files changed

+752
-2
lines changed

core/dbobject.class.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -3345,10 +3345,12 @@ public function DBUpdate()
33453345
$this->m_bDirty = false;
33463346
$this->m_aTouchedAtt = array();
33473347
$this->m_aModifiedAtt = array();
3348-
3348+
$bModifiedByUpdateDone = false;
33493349
try {
33503350
$this->EventUpdateDone($aChanges);
33513351
$this->AfterUpdate();
3352+
// Save the status as it is reset just after...
3353+
$bModifiedByUpdateDone = $this->IsModified();
33523354

33533355
// Reset original values although the object has not been reloaded
33543356
foreach ($this->m_aLoadedAtt as $sAttCode => $bLoaded) {
@@ -3388,7 +3390,7 @@ public function DBUpdate()
33883390
MetaModel::StopReentranceProtection(Metamodel::REENTRANCE_TYPE_UPDATE, $this);
33893391
}
33903392

3391-
if ($this->IsModified()) {
3393+
if ($this->IsModified() || $bModifiedByUpdateDone) {
33923394
// Controlled reentrance
33933395
$this->DBUpdate();
33943396
}

0 commit comments

Comments
 (0)