From 04a5c19df665189378049b23f7dbd08ecef11d7e Mon Sep 17 00:00:00 2001 From: Lorenzo Ancora <34890309+LorenzoAncora@users.noreply.github.com> Date: Thu, 15 Nov 2018 14:06:38 +0100 Subject: [PATCH] Search: compatibility with PostgreSQL The search query used the comparison operator in a non-standard way, incompatible with PostgreSQL (HTTP error 500 in people/search). PostgreSQL does not do the implicit casting from integer to boolean, you must explicitly write TRUE/FALSE (recommended) or implement explicit casting (not ideal with frequent queries). --- app/Helpers/SearchHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Helpers/SearchHelper.php b/app/Helpers/SearchHelper.php index 31976883ba8..553aad31620 100644 --- a/app/Helpers/SearchHelper.php +++ b/app/Helpers/SearchHelper.php @@ -38,7 +38,7 @@ public static function searchContacts($query, $limitPerPage, $order) ]); })->paginate($limitPerPage); } else { - $results = Contact::search($needle, $accountId, $limitPerPage, $order, 'and is_partial=0'); + $results = Contact::search($needle, $accountId, $limitPerPage, $order, 'AND is_partial = FALSE'); } return $results;