diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index f9d9309a7556c8ff9c9da0e36f7d2145c5b5bbd3..61fcc4dc502e391bc7df1ffe067afeae5a59e9b0 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -175,6 +175,21 @@ if (empty($reshook)) $result=$object->update($object->id, $user); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } + + if ($action == 'update_extras') { + $object->fetch($id); + + // Fill array 'array_options' with data from update form + $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); + if ($ret < 0) $error++; + if (! $error) + { + $result = $object->insertExtraFields(); + if ($result < 0) $error++; + } + if ($error) $action = 'edit_extras'; + } } diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 6a0336aab387e00e777e9cb48f4c5be5f60d19b5..ba5f099365c3f43360773762966d40db1bb71da3 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -825,7 +825,7 @@ function activateModule($value,$withdeps=1) { // Activation of modules this module depends on // this->depends may be array('modModule1', 'mmodModule2') or array('always'=>"modModule1", 'FR'=>'modModule2') - foreach ($objMod->depend as $key => $modulestring) + foreach ($objMod->depends as $key => $modulestring) { if ((! is_numeric($key)) && $key != 'always' && $key != $mysoc->country_code) {