Skip to content

Conversation

@VincentLanglet
Copy link
Contributor

Q A
Branch? 4.2
Tickets Closes #..., closes #...
License MIT
Doc PR api-platform/docs#...

$queryBuilder->setParameter($parameterName, $this->formatLikeValue($values));

$likeExpression = 'LOWER('.$field.') LIKE :'.$parameterName.' ESCAPE \'\\\'';
$likeExpression = 'LOWER('.$field.') LIKE LOWER(:'.$parameterName.') ESCAPE \'\\\'';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is two way to fix this

  • Using mb_strtolower in setParameter
  • Using Lower(foo) LIKE Lower(bar)

I feel like mixing lower in php and sql is weird (and the origin of error) while using both lower funciton in SQL ensure consistency.

NB: the bug doesnt occur on searchFilter since wrapCase was called on both expression

$wrapCase($aliasedField),
$wrapCase((string) $queryBuilder->expr()->concat("'%'", $keyValueParameter, "'%'"))

@VincentLanglet
Copy link
Contributor Author

PHPStan failure is unrelated ; I would prefer fixing it in another PR.

@VincentLanglet VincentLanglet marked this pull request as ready for review January 22, 2026 23:30
@VincentLanglet VincentLanglet changed the title Try accented letters on partial search filter fix(doctirne): PartialSearchFilter on multibyte characters Jan 22, 2026
@VincentLanglet VincentLanglet requested a review from soyuka January 22, 2026 23:30
@VincentLanglet VincentLanglet changed the title fix(doctirne): PartialSearchFilter on multibyte characters fix(doctrine): PartialSearchFilter on multibyte characters Jan 22, 2026
@soyuka soyuka merged commit f5ba974 into api-platform:4.2 Jan 23, 2026
129 of 130 checks passed
@soyuka
Copy link
Member

soyuka commented Jan 23, 2026

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants