Fix bug in fetch_optionals

This commit is contained in:
fhenry 2013-04-26 10:51:17 +02:00
parent b4f3e9d5a8
commit 30ad2f1609
2 changed files with 6 additions and 3 deletions

View File

@ -2023,6 +2023,7 @@ abstract class CommonObject
$optionsArray = $extrafields->fetch_name_optionals_label($this->table_element); $optionsArray = $extrafields->fetch_name_optionals_label($this->table_element);
} }
// Request to get complementary values // Request to get complementary values
if (count($optionsArray) > 0) if (count($optionsArray) > 0)
{ {
@ -2044,13 +2045,15 @@ abstract class CommonObject
foreach ($tab as $key => $value) 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 // we can add this attribute to adherent object
$this->array_options["options_$key"]=$value; $this->array_options["options_$key"]=$value;
} }
} }
} }
$this->db->free($resql); $this->db->free($resql);
} }
else else

View File

@ -543,7 +543,6 @@ class ExtraFields
{ {
while ($tab = $this->db->fetch_object($resql)) while ($tab = $this->db->fetch_object($resql))
{ {
// we can add this attribute to adherent object // we can add this attribute to adherent object
if ($tab->type != 'separate') if ($tab->type != 'separate')
{ {
@ -560,6 +559,7 @@ class ExtraFields
$this->attribute_pos[$tab->name]=$tab->pos; $this->attribute_pos[$tab->name]=$tab->pos;
} }
} }
return $array_name_label; return $array_name_label;
} }
else else