diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php index 51b3aa550b8c1..4d67ffe024fe0 100644 --- a/htdocs/expedition/class/api_shipments.class.php +++ b/htdocs/expedition/class/api_shipments.class.php @@ -483,7 +483,12 @@ public function put($id, $request_data = null) $this->shipment->context['caller'] = sanitizeVal($request_data['caller'], 'aZ09'); continue; } - + if ($field == 'array_options' && is_array($value)) { + foreach ($value as $index => $val) { + $this->shipment->array_options[$index] = $this->_checkValForAPI($field, $val, $this->shipment); + } + continue; + } $this->shipment->$field = $this->_checkValForAPI($field, $value, $this->shipment); } diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 47fae30ca4b07..f7b5c2aeb3b3f 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1252,6 +1252,14 @@ public function update($user = null, $notrigger = 0) $this->errors[] = "Error ".$this->db->lasterror(); } + // Actions on extra fields + if (!$error) { + $result = $this->insertExtraFields(); + if ($result < 0) { + $error++; + } + } + if (!$error && !$notrigger) { // Call trigger $result = $this->call_trigger('SHIPPING_MODIFY', $user);