From c80fa48225e489fe46a7b2225c13eef48afe683f Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Thu, 1 Feb 2018 09:31:04 +0100 Subject: [PATCH] FIX update_extras on fourn card --- htdocs/fourn/card.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 328157af7bf..d99df78c27c 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -101,6 +101,21 @@ if (empty($reshook)) $result=$object->setPaymentMethods(GETPOST('mode_reglement_supplier_id','int')); if ($result < 0) dol_print_error($db,$object->error); } + 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'; + } }