Fix: different behavior on extrafield updates. (#30150)
This commit is contained in:
parent
fb57a0342b
commit
ada3ed0a7c
5 changed files with 15 additions and 10 deletions
|
|
@ -1513,16 +1513,17 @@ if (empty($reshook)) {
|
|||
|
||||
if ($action == 'update_extras') {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$attribute_name = GETPOST('attribute', 'restricthtml');
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, $attribute_name);
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Actions on extra fields
|
||||
$result = $object->insertExtraFields('ORDER_MODIFY');
|
||||
$result = $object->updateExtraField($attribute_name, 'ORDER_MODIFY');
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -3070,16 +3070,17 @@ if (empty($reshook)) {
|
|||
|
||||
if ($action == 'update_extras') {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$attribute_name = GETPOST('attribute', 'restricthtml');
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, $attribute_name);
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Actions on extra fields
|
||||
$result = $object->insertExtraFields('BILL_MODIFY');
|
||||
$result = $object->updateExtraField($attribute_name, 'BILL_MODIFY');
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -198,16 +198,17 @@ if (empty($reshook)) {
|
|||
|
||||
if ($action == 'update_extras') {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$attribute_name = GETPOST('attribute', 'restricthtml');
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, $attribute_name);
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Actions on extra fields
|
||||
$result = $object->insertExtraFields('SHIPMENT_MODIFY');
|
||||
$result = $object->updateExtraField($attribute_name, 'SHIPMENT_MODIFY');
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -750,16 +750,17 @@ if (empty($reshook)) {
|
|||
|
||||
if ($action == 'update_extras') {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$attribute_name = GETPOST('attribute', 'restricthtml');
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, $attribute_name);
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Actions on extra fields
|
||||
$result = $object->insertExtraFields('INTERVENTION_MODIFY');
|
||||
$result = $object->updateExtraField($attribute_name, 'INTERVENTION_MODIFY');
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -1132,15 +1132,16 @@ if (empty($reshook)) {
|
|||
$result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')), GETPOSTINT('calculation_mode'));
|
||||
} elseif ($action == 'update_extras') {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
$attribute_name = GETPOST('attribute', 'restricthtml');
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, $attribute_name);
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $object->insertExtraFields('PROPOSAL_SUPPLIER_MODIFY');
|
||||
$result = $object->updateExtraField($attribute_name, 'PROPOSAL_SUPPLIER_MODIFY');
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
|
|
|
|||
Loading…
Reference in a new issue