From d0dc792b3cd829c6ef86fa555f880ed8400d3deb Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 17 Nov 2014 11:17:45 +0100 Subject: [PATCH] check extrafields before inserting in DB --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e363eda6e4a..5af3f5a93c3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2195,7 +2195,7 @@ abstract class CommonObject { $attributeKey = substr($key,8); // Remove 'options_' prefix // Add field of attribut - if ($extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate + if (isset($extrafields->attribute_type[$attributeKey]) && $extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate $sql.=",".$attributeKey; } $sql .= ") VALUES (".$this->id; @@ -2203,7 +2203,7 @@ abstract class CommonObject { $attributeKey = substr($key,8); // Remove 'options_' prefix // Add field o fattribut - if($extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate) + if(isset($extrafields->attribute_type[$attributeKey]) && $extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate) { if ($this->array_options[$key] != '') {