From 0964cb87b5070c7f65816d256153c268b287b2da Mon Sep 17 00:00:00 2001 From: Caroline Salib Date: Fri, 21 Apr 2017 22:05:39 -0300 Subject: [PATCH] Corrigido problema nas buscas de campos autocomplete; portabilis/ieducar#167 --- ieducar/lib/Portabilis/Controller/ApiCoreController.php | 4 ++-- ieducar/modules/Api/Views/MunicipioController.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ieducar/lib/Portabilis/Controller/ApiCoreController.php b/ieducar/lib/Portabilis/Controller/ApiCoreController.php index edae3c5..11487fd 100644 --- a/ieducar/lib/Portabilis/Controller/ApiCoreController.php +++ b/ieducar/lib/Portabilis/Controller/ApiCoreController.php @@ -490,7 +490,7 @@ class ApiCoreController extends Core_Controller_Page_EditController $selectFields = join(', ', $searchOptions['selectFields']); return "select distinct $selectFields from $namespace.$table - where $idAttr like $1||'%' order by $idAttr limit 15"; + where $idAttr::varchar like $1||'%' order by $idAttr limit 15"; } @@ -506,7 +506,7 @@ class ApiCoreController extends Core_Controller_Page_EditController $selectFields = join(', ', $searchOptions['selectFields']); return "select distinct $selectFields from $namespace.$table - where lower(to_ascii($labelAttr)) like lower(to_ascii($1))||'%' order by $labelAttr limit 15"; + where lower($labelAttr) like lower($1)||'%' order by $labelAttr limit 15"; } protected function sqlParams($query) { diff --git a/ieducar/modules/Api/Views/MunicipioController.php b/ieducar/modules/Api/Views/MunicipioController.php index 5465f69..3b6712d 100644 --- a/ieducar/modules/Api/Views/MunicipioController.php +++ b/ieducar/modules/Api/Views/MunicipioController.php @@ -48,7 +48,7 @@ class MunicipioController extends ApiCoreController // " - ()", ex: "1 - Içara (SC)" protected function formatResourceValue($resource) { $siglaUf = $resource['sigla_uf']; - $nome = $this->toUtf8($resource['name'], array('transform' => true)); + $nome = $resource['name']; return $resource['id'] . " - $nome ($siglaUf)"; } -- libgit2 0.21.2