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);
}
// 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

View File

@ -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