2
0
forked from Wavyzz/dolibarr

Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 17.0

This commit is contained in:
Laurent Destailleur
2023-05-26 11:18:08 +02:00
2 changed files with 10 additions and 8 deletions

View File

@@ -9899,14 +9899,16 @@ abstract class CommonObject
}
// Force values to default values when known
foreach ($this->fields as $key => $value) {
// If fields are already set, do nothing
if (array_key_exists($key, $fields)) {
continue;
}
if (property_exists($this, 'fields')) {
foreach ($this->fields as $key => $value) {
// If fields are already set, do nothing
if (array_key_exists($key, $fields)) {
continue;
}
if (!empty($value['default'])) {
$this->$key = $value['default'];
if (!empty($value['default'])) {
$this->$key = $value['default'];
}
}
}

View File

@@ -375,7 +375,7 @@ if (empty($reshook)) {
$entrepot_id = 0;
}
$ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i]);
$ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOSTINT($qty), $array_options[$i]);
if ($ret < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$error++;