Skip to content

Commit

Permalink
pkp#10948 Fixed case insensitive matching of vocabs
Browse files Browse the repository at this point in the history
  • Loading branch information
touhidurabir committed Feb 19, 2025
1 parent fcf9439 commit fe56411
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions classes/controlledVocab/ControlledVocabEntryMatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

namespace PKP\controlledVocab;

use Illuminate\Database\PostgresConnection;
use Illuminate\Support\Facades\DB;

enum ControlledVocabEntryMatch
{
case EXACT;
Expand All @@ -22,8 +25,8 @@ enum ControlledVocabEntryMatch
public function operator(): string
{
return match ($this) {
static::EXACT => "=",
static::PARTIAL => "LIKE"
static::EXACT => '=',
static::PARTIAL => DB::connection() instanceof PostgresConnection ? 'ILIKE' : 'LIKE'
};
}

Expand Down

0 comments on commit fe56411

Please sign in to comment.