FIX avoid php warnings (#35967)
This commit is contained in:
parent
ce7e9f4027
commit
210328dd33
1 changed files with 10 additions and 4 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue