This commit is contained in:
Laurent Destailleur 2023-05-25 17:43:37 +02:00
parent 3ae9b07fee
commit 884ac621de

View file

@ -9738,14 +9738,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'];
}
}
}