From 5af33ffe0a74ea207f8f208d49a57d7f251ed244 Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Tue, 17 Sep 2019 11:59:17 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B02293=20Saves=20changes=20in=20DBObjet::D?= =?UTF-8?q?BUpdate,=20just=20before=20the=20AfterUpdate=20call=20This=20wi?= =?UTF-8?q?ll=20allow=20to=20get=20changes=20made=20in=20ComputeValues,=20?= =?UTF-8?q?OnUpdate,=20etc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/cmdbabstract.class.inc.php | 6 ------ core/dbobject.class.php | 9 +++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index f7162bc88..ae07c391c 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -56,8 +56,6 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay protected $m_iFormId; // The ID of the form used to edit the object (when in edition mode !) protected static $iGlobalFormId = 1; protected $aFieldsMap; - /** @var array attname => currentvalue Persists changes for {@link DBUpdate} */ - protected $m_aChanges; /** * If true, bypass IsActionAllowedOnAttribute when writing this object @@ -3733,8 +3731,6 @@ EOF public function DBUpdate() { - $this->m_aChanges = $this->ListChanges(); - $res = parent::DBUpdate(); $this->SetWarningsAsSessionMessages('update'); @@ -3767,8 +3763,6 @@ EOF unset($aUpdateReentrance[$sKey]); } - $this->m_aChanges = array(); - return $res; } diff --git a/core/dbobject.class.php b/core/dbobject.class.php index 43c89dbac..2d2e11b17 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -133,6 +133,11 @@ abstract class DBObject implements iDisplay * * false => not modified (the same value as the original value was set) */ protected $m_aModifiedAtt = array(); + /** + * @var array attname => currentvalue Persists changes for {@link DBUpdate} + * @since 2.7.0 N°2293 + */ + protected $m_aChanges; /** * @var array Set of Synch data related to this object *