Check $showOnlyThisFields before setting defaults BT#12641

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent 3c97672b52
commit 205587f9ed
  1. 11
      main/inc/lib/extra_field.lib.php

@ -476,9 +476,20 @@ class ExtraField extends Model
$extraData = self::get_handler_extra_data($itemId);
if ($form) {
if (!empty($showOnlyThisFields)) {
$setData = [];
foreach ($showOnlyThisFields as $variable) {
$extraName = 'extra_'.$variable;
if (in_array($extraName, array_keys($extraData))) {
$setData[$extraName] = $extraData[$extraName];
};
}
$form->setDefaults($setData);
} else {
$form->setDefaults($extraData);
}
}
}
$conditions = [];
if ($filter) {

Loading…
Cancel
Save