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'];
}
}
}