Page 1 of 1

error when searching in browse form

Posted: Wed Mar 29, 2023 9:31 am
by johan
Hi
My browse form displays all rows correct. When I search a record, I get no result.
In Debug I get this output.

<code>

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'as titularis USING utf8) LIKE "%209%" OR CONVERT(m2.naam as vervanger USING u...' at line 3

===SQL===========

SELECT re_id,re_id,m1.naam as titularis,m2.naam as vervanger
from contracten a inner join list l on l.id = a.re_functie inner join list l2 on l2.id = a.re_afdeling left join titularis b on a.re_id = b.contract_id left join medewerkers m1 on m1.id = b.medewerker left join vervanging c on c.vv_contract_id = a.re_id and c.vv_parent_id = b.medewerker left join medewerkers m2 on m2.id = c.vv_medewerker
where b.eind is NULL and c.vv_eind is NULL AND ( (CONVERT(re_id USING utf8) LIKE "%209%" OR CONVERT(m1.naam as titularis USING utf8) LIKE "%209%" OR CONVERT(m2.naam as vervanger USING utf8) LIKE "%209%") ) LIMIT 0, 20

===BACK TRACE====

/var/www/html/personeel/core/nuform.php - line 1226 (nuRunQuery)

/var/www/html/personeel/core/nuform.php - line 455 (nuBrowseRows)
</code>

Any idea?
Johan

Re: error when searching in browse form

Posted: Wed Mar 29, 2023 10:08 am
by kev1n
This is now fixed in the latest on Github.

Either update nuBuilder or patch your existing /core/nuform.php file:


Replace the function nuBrowseWhereClause() in nuform.php

And add the new function nuBrowseRemoveFieldAlias() in nuform.php

Re: error when searching in browse form

Posted: Wed Mar 29, 2023 6:45 pm
by johan
Kev1n
Problem solved after update.
Thanks
Johan