mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
init array_options in current object if we don't have record for it (#29689)
* init array_options in current object if we don't have record for it * pre-commit * change '' to null * change comment --------- Co-authored-by: jpb <jean-pascal.boudet@atm-consulting>
This commit is contained in:
committed by
GitHub
parent
82b3fd0739
commit
bdfe5d0afd
@@ -6385,6 +6385,16 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/**
|
||||
We are in a situation where the current object has no values in its extra fields.
|
||||
We want to initialize all the values to null so that the array_option is accessible in other contexts (especially in document generation).
|
||||
**/
|
||||
if (is_array($extrafields->attributes[$this->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
|
||||
$this->array_options['options_' . $key] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If field is a computed field, value must become result of compute (regardless of whether a row exists
|
||||
|
||||
Reference in New Issue
Block a user