Skip to content

Commit

Permalink
Issue #4182: merge back from rel-11_0
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelThumes authored and svenoe committed Feb 24, 2025
1 parent 7ced1e0 commit d79e1c0
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions Kernel/System/DynamicField/Driver/BaseReference.pm
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,25 @@ sub SearchSQLGet {
}

my $DBObject = $Kernel::OM->Get('Kernel::System::DB');
my $Lower = '';
if ( $DBObject->GetDatabaseFunction('CaseSensitive') ) {
$Lower = 'LOWER';

# TODO: this should be changed to bind variables
my $SQL;
if ( $Self->{TableAttribute} eq 'value_int' ) {
$SQL = " $Param{TableAlias}.$Self->{TableAttribute} $Operators{ $Param{Operator} } $Param{SearchTerm}";
}
elsif ( $Self->{TableAttribute} eq 'value_text' ) {
my $Lower = '';
if ( $DBObject->GetDatabaseFunction('CaseSensitive') ) {
$Lower = 'LOWER';
}

my $SQL = " $Lower($Param{TableAlias}.$Self->{TableAttribute}) $Operators{ $Param{Operator} } ";
$SQL .= "$Lower('" . $DBObject->Quote( $Param{SearchTerm} ) . "') ";
$SQL = " $Lower($Param{TableAlias}.$Self->{TableAttribute}) $Operators{ $Param{Operator} } ";
$SQL .= "$Lower('" . $DBObject->Quote( $Param{SearchTerm} ) . "') ";
}
else {
$SQL = " $Param{TableAlias}.$Self->{TableAttribute} $Operators{ $Param{Operator} } '";
$SQL .= $DBObject->Quote( $Param{SearchTerm} ) . "' ";
}

return $SQL;
}
Expand Down

0 comments on commit d79e1c0

Please sign in to comment.