Skip to content

Commit

Permalink
Issue #3379: Changed checks in AgentReferenceSearch.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhaerter authored and svenoe committed May 7, 2024
1 parent 3185f02 commit b4c21ef
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions Kernel/Modules/AgentReferenceSearch.pm
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,28 @@ sub Run {
# [...]_FieldName_0a1b2c_0 (process suffix with set or multivalue)
# [...]_FieldName_0a1b2c_0_0 (process suffix with set and multivalue)

# attempt match without process suffix
if ( $Field && $Field =~ m{ \A (?: Autocomplete (?: _Search )? ) _DynamicField_ ([A-Za-z0-9\-]*?) (?:_[0-9]+){0,2} \z }xms ) {
$FieldName = $1; # remove either the prefix 'Autocomplete_DynamicField_' or the prefix 'Search_DynamicField_'
}
my $Error = 1;
if ($Field) {

# match with activity dialog entity id is needed
if ( $ActivityDialogEntityID && $LayoutObject->{SessionSource} eq 'CustomerInterface' ) {
if ( $Field && $Field =~ m{ \A (?: Autocomplete (?: _Search )? ) _DynamicField_ ([A-Za-z0-9\-]*?) (_$ActivityDialogEntityID) (?:_[0-9]+){0,2} \z }xms ) {
$FieldName = $1; # remove either the prefix 'Autocomplete_DynamicField_' or the prefix 'Search_DynamicField_'
$ProcessSuffix = $2;
$Error = 0;
}
}

# attempt match with process suffix
elsif ( $Field && $Field =~ m{ \A (?: Autocomplete (?: _Search )? ) _DynamicField_ ([A-Za-z0-9\-]*?) (_$ActivityDialogEntityID) (?:_[0-9]+){0,2} \z }xms ) {
$FieldName = $1; # remove either the prefix 'Autocomplete_DynamicField_' or the prefix 'Search_DynamicField_'
$ProcessSuffix = $2;
# match without activity dialog entity id is needed
else {
if ( $Field =~ m{ \A (?: Autocomplete (?: _Search )? ) _DynamicField_ ([A-Za-z0-9\-]*?) (?:_[0-9]+){0,2} \z }xms ) {
$FieldName = $1; # remove either the prefix 'Autocomplete_DynamicField_' or the prefix 'Search_DynamicField_'
$Error = 0;
}
}
}
else {

if ($Error) {
return $LayoutObject->JSONReply(
Data => {
Success => 0,
Expand Down

0 comments on commit b4c21ef

Please sign in to comment.