Inconsistent case sensitivity between global search and text filters

Aperta
#7,898 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
57/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php, symfony
Ambito
backend, database

Direzione di ricerca

Start by tracing how global search and the built-in text filter build their Doctrine queries, then compare how each handles case sensitivity. The issue gives no file or test names, so locate the filter implementation and related tests first. Done means both mechanisms return consistent results for the same search term on PostgreSQL, with the intended default or configuration behavior covered by tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

feature
Inconsistent case sensitivity between global search and text filters

Description

There seems to be an inconsistency between the global search functionality (the search bar at the top of the CRUD index page) and the built-in text filters.

When using the global search, EasyAdmin generates a query that applies LOWER() to the database column and the search parameter.

However, when using a text filter, the generated query does not apply LOWER().

As a result, both search mechanisms behave differently when searching for the same phrase.

This is particularly noticeable when using PostgreSQL 18, where the LIKE operator is case-sensitive.

Steps to reproduce
  1. Use PostgreSQL 18 as the database.
  2. Create an entity with a string property (e.g. name).
  3. Add name to the global search fields.
  4. Add a text filter for the same name property.
  5. Insert records with different letter casing, for example:
    • John Smith
    • JOHN SMITH
    • john smith
  6. Search for john using the global search.
  7. Repeat the same search using the text filter.
Actual behavior

The global search uses case-insensitive matching by applying LOWER() to both the database column and the search parameter.

The text filter does not apply the same transformation, resulting in case-sensitive matching with PostgreSQL.

Consequently, the two search mechanisms return different results for the same search term.

Expected behavior

Both global search and text filters should behave consistently regarding case sensitivity.

Ideally, text filters should also perform case-insensitive matching by default, or at least provide a consistent way to configure this behavior.

Environment
  • EasyAdmin: 5.x
  • Database: PostgreSQL 18
  • ORM: Doctrine ORM
  • PHP: 8.5
  • Symfony: 8.1
Lingua principale
PHP
Stelle
4.3k
Fork
1.1k
Merge medio
2g 9h
PR unite (30g)
52

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di EasyCorp/EasyAdminBundle

Tutte le issue di EasyCorp/EasyAdminBundle

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.