From 0f80ee757f6c6dfec4de05febc7d23809801376c Mon Sep 17 00:00:00 2001 From: phf Date: Fri, 9 Jun 2017 16:37:05 +0200 Subject: [PATCH 1/2] Fix can not update extrafields values --- htdocs/comm/card.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index f9d9309a755..61fcc4dc502 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'; + } } From c1f3a168cd62d7e9b3bbb5f8a1f37343e3e5ecd0 Mon Sep 17 00:00:00 2001 From: phf Date: Fri, 9 Jun 2017 16:57:20 +0200 Subject: [PATCH 2/2] Fix wrong attribute name for loop --- htdocs/core/lib/admin.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 6a0336aab38..ba5f099365c 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) {