Skip to content

Commit

Permalink
Issue #2165: Improving dynamicfield db search by prioritizing given v…
Browse files Browse the repository at this point in the history
…alue over saved one in non-creation ticket screens.
  • Loading branch information
stefanhaerter committed Jan 26, 2024
1 parent 318271c commit 1e9ccac
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Kernel/System/DynamicFieldDB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,15 @@ sub DatabaseSearchByConfig {
Name => $DFName,
);

# get the current dynamic field value to process
my $DynamicFieldValue = $Kernel::OM->Get('Kernel::System::DynamicField::Backend')->ValueGet(
DynamicFieldConfig => $DFConfig,
ObjectID => $Param{TicketID},
);
my $DynamicFieldValue = $Param{$Param{Config}->{PossibleValues}->{$Key}};

if ( !$DynamicFieldValue ) {
# get the current dynamic field value to process
$DynamicFieldValue = $Kernel::OM->Get('Kernel::System::DynamicField::Backend')->ValueGet(
DynamicFieldConfig => $DFConfig,
ObjectID => $Param{TicketID},
);
}

$PreparedPossibleValues->{$SequenceNumber}->{$Key} = $DynamicFieldValue || '';
}
Expand Down

0 comments on commit 1e9ccac

Please sign in to comment.