mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge pull request #24867 from noec764/15_FIX_init_default_values_for_specimens
FIX: default values were not set for specimen objects
This commit is contained in:
commit
24b4e3e183
|
|
@ -9452,6 +9452,19 @@ abstract class CommonObject
|
|||
$this->{$key} = $value;
|
||||
}
|
||||
}
|
||||
|
||||
// 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 (!empty($value['default'])) {
|
||||
$this->$key = $value['default'];
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user