Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Lookup Search Issue

Questions related to using nuBuilder Forte.
Post Reply
rrandall
Posts: 9
Joined: Fri Dec 24, 2021 11:31 am

Lookup Search Issue

Unread post by rrandall »

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?
Capture.PNG
You do not have the required permissions to view the files attached to this post.
kev1n
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

Unread post by kev1n »

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.
rrandall
Posts: 9
Joined: Fri Dec 24, 2021 11:31 am

Re: Lookup Search Issue

Unread post by rrandall »

Thank you kev1n :)
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)
kev1n
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

Unread post by kev1n »

Try this patch:

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));
with

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 . '%'));
rrandall
Posts: 9
Joined: Fri Dec 24, 2021 11:31 am

Re: Lookup Search Issue

Unread post by rrandall »

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.
kev1n
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

Unread post by kev1n »

What do you enter, what do you see and what result do you expect?
Video_2022-04-12_114150.gif
You do not have the required permissions to view the files attached to this post.
rrandall
Posts: 9
Joined: Fri Dec 24, 2021 11:31 am

Re: Lookup Search Issue

Unread post by rrandall »

When typing “lighter” as the search phrase and hitting enter, the browse screen pops up with the correct search criteria:
c1.png
c2.png
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”.
c3.png
c4.png
You do not have the required permissions to view the files attached to this post.
kev1n
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

Unread post by kev1n »

Doing the same, but using “high” as the search phrase, does nothing but clear the box where the word “high” was typed.
That works for me, see my recording.
Post Reply