Skip to content

Commit

Permalink
Issue #2987: Merged two function calls for consistent object id handl…
Browse files Browse the repository at this point in the history
…ing.
  • Loading branch information
stefanhaerter authored and svenoe committed Feb 20, 2024
1 parent 35a1c06 commit 2e62b74
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions Kernel/System/DynamicField/Driver/Lens.pm
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ sub ValueSet {
EditFieldValue => 0,
Set => 0,
DynamicFieldConfig => $AttributeDFConfig,
ObjectID => $ReferencedObjectID->[0],
ObjectID => $ReferencedObjectID,
);
return unless $Success;
}
Expand Down Expand Up @@ -838,24 +838,16 @@ sub _GetReferencedObjectID {

if ( $Param{EditFieldValue} ) {

# fetching a single object id for a specified set index
if ( exists $Param{SetIndex} ) {
return $Kernel::OM->Get('Kernel::System::DynamicField::Backend')->EditFieldValueGet(
DynamicFieldConfig => {
$ReferenceDFConfig->%*,
Name => $ReferenceDFConfig->{Name} . '_' . $Param{SetIndex},
},
ParamObject => $Kernel::OM->Get('Kernel::System::Web::Request'),
TransformDates => 0,
ForLens => 1,
);
}

my $ObjectID = $Kernel::OM->Get('Kernel::System::DynamicField::Backend')->EditFieldValueGet(
DynamicFieldConfig => $ReferenceDFConfig,
ParamObject => $Kernel::OM->Get('Kernel::System::Web::Request'),
TransformDates => 0,
ForLens => 1,
DynamicFieldConfig => {
$ReferenceDFConfig->%*,

# fetching a single object id for a specified set index
Name => $ReferenceDFConfig->{Name} . ( exists $Param{SetIndex} ? '_' . $Param{SetIndex} : '' ),
},
ParamObject => $Kernel::OM->Get('Kernel::System::Web::Request'),
TransformDates => 0,
ForLens => 1,
);

return $ObjectID->[0];
Expand Down

0 comments on commit 2e62b74

Please sign in to comment.