mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
fix error when search pattern is empty
This commit is contained in:
parent
7ffb3dc74f
commit
4257a918f3
@ -122,7 +122,7 @@ class SearchController extends AbstractController
|
|||||||
|
|
||||||
public function searchAction(Request $request, $_format)
|
public function searchAction(Request $request, $_format)
|
||||||
{
|
{
|
||||||
$pattern = $request->query->get('q', '');
|
$pattern = trim($request->query->get('q', ''));
|
||||||
|
|
||||||
if ('' === $pattern) {
|
if ('' === $pattern) {
|
||||||
switch ($_format) {
|
switch ($_format) {
|
||||||
|
@ -136,8 +136,11 @@ final class PersonACLAwareRepository implements PersonACLAwareRepositoryInterfac
|
|||||||
$andWhereSearchClause = [];
|
$andWhereSearchClause = [];
|
||||||
$andWhereSearchClauseArgs = [];
|
$andWhereSearchClauseArgs = [];
|
||||||
|
|
||||||
if ('' !== $default) {
|
if ('' !== trim($default)) {
|
||||||
foreach (explode(' ', $default) as $str) {
|
foreach (explode(' ', $default) as $str) {
|
||||||
|
if ('' === trim($str)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$pertinence[] =
|
$pertinence[] =
|
||||||
'STRICT_WORD_SIMILARITY(LOWER(UNACCENT(?)), person.fullnamecanonical) + ' .
|
'STRICT_WORD_SIMILARITY(LOWER(UNACCENT(?)), person.fullnamecanonical) + ' .
|
||||||
"(person.fullnamecanonical LIKE '%' || LOWER(UNACCENT(?)) || '%')::int + " .
|
"(person.fullnamecanonical LIKE '%' || LOWER(UNACCENT(?)) || '%')::int + " .
|
||||||
|
Loading…
x
Reference in New Issue
Block a user