From a9bc4973b40a4834228fefec69646a8738d3f82e Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Fri, 7 Feb 2025 17:24:43 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B08139=20-=20Fix=20ApplyStimulus=20during?= =?UTF-8?q?=20post=20update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/dbobject.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/dbobject.class.php b/core/dbobject.class.php index d54578705..fec3d472a 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -3862,7 +3862,9 @@ abstract class DBObject implements iDisplay */ protected function PostUpdateActions(array $aChanges): void { - $this->FireEventAfterWrite($aChanges, false, $this->sStimulusBeingApplied); + $sStimulusBeingApplied = $this->sStimulusBeingApplied; + $this->sStimulusBeingApplied = null; + $this->FireEventAfterWrite($aChanges, false, $sStimulusBeingApplied); $oKPI = new ExecutionKPI(); $this->AfterUpdate(); $oKPI->ComputeStatsForExtension($this, 'AfterUpdate'); @@ -3874,9 +3876,8 @@ abstract class DBObject implements iDisplay $this->ActivateOnObjectUpdateTriggersForTargetObjects(); $sClass = get_class($this); - if (utils::IsNotNullOrEmptyString($this->sStimulusBeingApplied)) + if (utils::IsNotNullOrEmptyString($sStimulusBeingApplied)) { - $this->sStimulusBeingApplied = null; $sStateAttCode = MetaModel::GetStateAttributeCode($sClass); $sPreviousState = $this->m_aPreviousValuesForUpdatedAttributes[$sStateAttCode]; // Change state triggers...