Skip to content

Commit

Permalink
Issue #2987: Code tidying.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhaerter committed Feb 20, 2024
1 parent c1a96b1 commit cf7819e
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions Kernel/System/DynamicField/Driver/Lens.pm
Original file line number Diff line number Diff line change
Expand Up @@ -860,24 +860,23 @@ sub _GetReferencedObjectID {
TransformDates => 0,
ForLens => 1,
);
return $ObjectID->[0];
}
else {
$ObjectID = $Kernel::OM->Get('Kernel::System::DynamicField::Backend')->ValueGet(
DynamicFieldConfig => $ReferenceDFConfig,
ObjectID => $Param{ObjectID},
ForLens => 1,
Set => $Param{Set},
);
}

$ObjectID = $Kernel::OM->Get('Kernel::System::DynamicField::Backend')->ValueGet(
DynamicFieldConfig => $ReferenceDFConfig,
ObjectID => $Param{ObjectID},
ForLens => 1,
Set => $Param{Set},
);

# in set case, we need to map the returned array of arrays into an array of first values as multivalue lenses are not supported at the moment
if ( $Param{Set} ) {
my @ObjectIDs = map { $_->[0] } $ObjectID->@*;
return \@ObjectIDs;
}

return $ObjectID->[0] if ref $ObjectID;
return $ObjectID;
return $ObjectID->[0];
}

1;

0 comments on commit cf7819e

Please sign in to comment.