diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 3dd183a5b1348f9a9650b6f2a1a491bb7ae13bcb..7aac8234b5f102311e6f75506e266961dcfe48a3 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -2023,6 +2023,7 @@ abstract class CommonObject
$optionsArray = $extrafields->fetch_name_optionals_label($this->table_element);
}
+
// Request to get complementary values
if (count($optionsArray) > 0)
{
@@ -2044,13 +2045,15 @@ abstract class CommonObject
foreach ($tab as $key => $value)
{
- if ($key != 'rowid' && $key != 'tms' && $key != 'fk_member')
+ //Test fetch_array ! is_int($key) because fetch_array seult is a mix table with Key as alpha and Key as int (depend db engine)
+ if ($key != 'rowid' && $key != 'tms' && $key != 'fk_member' && ! is_int($key))
{
// we can add this attribute to adherent object
$this->array_options["options_$key"]=$value;
}
}
}
+
$this->db->free($resql);
}
else
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 6f82520c23004c50f4211382dc3f7d315aae3ee4..17226e7d461637b8c1c07c940634f4a2bc1569a9 100755
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -543,7 +543,6 @@ class ExtraFields
{
while ($tab = $this->db->fetch_object($resql))
{
-
// we can add this attribute to adherent object
if ($tab->type != 'separate')
{
@@ -560,6 +559,7 @@ class ExtraFields
$this->attribute_pos[$tab->name]=$tab->pos;
}
}
+
return $array_name_label;
}
else
@@ -882,7 +882,7 @@ class ExtraFields
function setOptionalsFromPost($extralabels,&$object)
{
global $_POST;
-
+
if (is_array($extralabels))
{
// Get extra fields