From 3e91fdda77a6763a347c2f419aec4e945f3d4053 Mon Sep 17 00:00:00 2001 From: fbosman Date: Mon, 1 Jul 2019 12:34:27 +0200 Subject: [PATCH] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5016d10780d..b065bb27470 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5008,6 +5008,8 @@ abstract class CommonObject $attributeLabel = $extrafields->attributes[$this->table_element]['label'][$attributeKey]; $attributeParam = $extrafields->attributes[$this->table_element]['param'][$attributeKey]; $attributeRequired = $extrafields->attributes[$this->table_element]['required'][$attributeKey]; + $attrfieldcomputed = $extrafields->attributes[$this->table_element]['computed'][$attributeKey]; + if ($attributeRequired) { @@ -5024,6 +5026,12 @@ abstract class CommonObject //dol_syslog("attributeLabel=".$attributeLabel, LOG_DEBUG); //dol_syslog("attributeType=".$attributeType, LOG_DEBUG); + if (!empty($attrfieldcomputed)) + { + $value = dol_eval($attrfieldcomputed, 1, 0); + $new_array_options[$key] = $value; + } + switch ($attributeType) {