From 2d6d1132c7deb74fd29042d1fe82bb6c732d75c8 Mon Sep 17 00:00:00 2001 From: acognet Date: Wed, 7 Oct 2020 13:26:38 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B03262=20-=20Avoid=20PHP=20notices=20on=20?= =?UTF-8?q?DBObject=20core=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/dbobject.class.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/core/dbobject.class.php b/core/dbobject.class.php index aba3b5a258..a693d26f88 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -3741,16 +3741,14 @@ abstract class DBObject implements iDisplay // save current object values in case of an action failure (in memory rollback) $aBackupValues = array(); - foreach(MetaModel::ListAttributeDefs($sClass) as $sAttCode => $oAttDef) - { - $value = $this->m_aCurrValues[$sAttCode]; - if (is_object($value)) - { - $aBackupValues[$sAttCode] = clone $value; - } - else - { - $aBackupValues[$sAttCode] = $value; + foreach (MetaModel::ListAttributeDefs($sClass) as $sAttCode => $oAttDef) { + if (isset($this->m_aCurrValues[$sAttCode])) { + $value = $this->m_aCurrValues[$sAttCode]; + if (is_object($value)) { + $aBackupValues[$sAttCode] = clone $value; + } else { + $aBackupValues[$sAttCode] = $value; + } } }