Hi,
I have a baffling problem I am unable to resolve, perhaps someone can get me going in the right direction:
I have a simple lookup on a subform for looking up product codes and descriptions, but it refuses to find any record when given the search phrase “high”. As an example, a record containing the word “highlighter” is found if searching for the phrase “lighter” but not found for any of these input search phrases:
"highlighter"
"high"
I am using versions:
DB - V.4.5-2022.01.30.00
Files: V.4.5-2022.02.01.01
Any ideas?
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Lookup Search Issue
-
- Posts: 9
- Joined: Fri Dec 24, 2021 11:31 am
Lookup Search Issue
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Lookup Search Issue
Hi,
I could replicate that here and think it's not supposed to be like that and I'll look into it.
As a workaround, click the magnifying glass after entering the string to see the lookup form.
I could replicate that here and think it's not supposed to be like that and I'll look into it.
As a workaround, click the magnifying glass after entering the string to see the lookup form.
-
- Posts: 9
- Joined: Fri Dec 24, 2021 11:31 am
Re: Lookup Search Issue
Thank you kev1n 
I also found this error in nuDebug that might be of help:

I also found this error in nuDebug that might be of help:
Code: Select all
[0] :
===USER==========
globeadmin
===PDO MESSAGE===
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 'HIGH'' != ''
ORDER BY prosup_code' at line 5
===SQL===========
SELECT product_supplier_id, prosup_code, prosup_description
FROM product_supplier JOIN product ON product.product_id = product_supplier.prosup_product_id
WHERE prosup_supplier_id = 'a0ba5ff9ec808d1'
AND (prosup_code LIKE ? OR prosup_description LIKE ?)
AND ''HIGH'' != ''
ORDER BY prosup_code
===BACK TRACE====
/var/www/html/core/nuform.php - line 829 (nuRunQuery)
/var/www/html/core/nuapi.php - line 79 (nuGetAllLookupList)
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Lookup Search Issue
Try this patch:
Replace in nuform.php from line 805 this code block
with
Replace in nuform.php from line 805 this code block
Code: Select all
$s = "
SELECT $id, $code, $description
$SQL->from
$SQL->where
AND $code = ?
ORDER BY $code
";
$s = nuReplaceHashVariables($s);
$t = nuRunQuery($s, array($C));
Code: Select all
$s = "
SELECT $id, $code, $description
$SQL->from
$SQL->where
AND $code LIKE ? AND '$C' != ''
ORDER BY $code
";
$s = nuReplaceHashVariables($s);
$t = nuRunQuery($s, array('%' . $C . '%'));
-
- Posts: 9
- Joined: Fri Dec 24, 2021 11:31 am
Re: Lookup Search Issue
Hi kev1n,
Thank you, I replaced the code as you suggested, but unfortunately it doesn't work. I still get the same result. However, I don't get any errors in the logs now.
Thank you, I replaced the code as you suggested, but unfortunately it doesn't work. I still get the same result. However, I don't get any errors in the logs now.
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Lookup Search Issue
What do you enter, what do you see and what result do you expect?
You do not have the required permissions to view the files attached to this post.
-
- Posts: 9
- Joined: Fri Dec 24, 2021 11:31 am
Re: Lookup Search Issue
When typing “lighter” as the search phrase and hitting enter, the browse screen pops up with the correct search criteria:
Doing the same, but using “high” as the search phrase, does nothing but clear the box where the word “high” was typed. I would have expected the same browse screen to pop up with the same 2 records listed, as both contain the word “high”.
Doing the same, but using “high” as the search phrase, does nothing but clear the box where the word “high” was typed. I would have expected the same browse screen to pop up with the same 2 records listed, as both contain the word “high”.
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Lookup Search Issue
That works for me, see my recording.Doing the same, but using “high” as the search phrase, does nothing but clear the box where the word “high” was typed.