Skip to content

Commit

Permalink
Issue #2725: Fixed table attribute in BaseReference sub SearchSQLGet.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhaerter committed Nov 30, 2023
1 parent d2df54d commit b0c75fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Kernel/System/DynamicField/Driver/BaseReference.pm
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,15 @@ sub SearchSQLGet {

if ( $Param{Operator} eq 'Empty' ) {
if ( $Param{SearchTerm} ) {
return " $Param{TableAlias}.value_text IS NULL ";
return " $Param{TableAlias}.$Self->{TableAttribute} IS NULL ";
}
else {
my $DatabaseType = $Kernel::OM->Get('Kernel::System::DB')->{'DB::Type'};
if ( $DatabaseType eq 'oracle' ) {
return " $Param{TableAlias}.value_text IS NOT NULL ";
return " $Param{TableAlias}.$Self->{TableAttribute} IS NOT NULL ";
}
else {
return " $Param{TableAlias}.value_text <> '' ";
return " $Param{TableAlias}.$Self->{TableAttribute} <> '' ";
}
}
}
Expand All @@ -163,7 +163,7 @@ sub SearchSQLGet {
$Lower = 'LOWER';
}

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

return $SQL;
Expand Down

0 comments on commit b0c75fd

Please sign in to comment.