FIX avoid php warnings (#35967)

This commit is contained in:
Regis Houssin 2025-10-28 01:07:22 +01:00 committed by GitHub
parent ce7e9f4027
commit 210328dd33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1251,12 +1251,18 @@ if ($action == 'create') {
$objectsav = $object; // Because Expedition is $expe and not $object that is wrongly a duplicate of $objectsrc.
$object = $expe;
// Propagate extrafieldsvalue from source object to shipment object
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
if (array_key_exists('options_'.$key, $objectsav->array_options)) { // We take value from order only if extrafield has the same name/key.
$object->array_options['options_'.$key] = $objectsav->array_options['options_'.$key];
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && !empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
if (array_key_exists('options_'.$key, $objectsav->array_options)) { // We take value from order only if extrafield has the same name/key.
$object->array_options['options_'.$key] = $objectsav->array_options['options_'.$key];
}
}
}
$parameters = array('objectsrc' => isset($objectsrc) ? $objectsrc : '', 'cols' => '3', 'socid' => $socid);
$parameters = array(
'objectsrc' => isset($objectsrc) ? $objectsrc : '',
'cols' => '3',
'socid' => $socid
);
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
$object = $objectsav;