Zen Cart Logo
Forums / General Questions / Search with a ( in the query returns an invalid keywords error message.

Search with a ( in the query returns an invalid keywords error message.

Views: 1,192

Results 1 to 9 of 9
27 Sep 2011, 9:51 PM
#1
patf avatar

patf

Zen Follower

Join Date:
May 2008
Posts:
200
Plugin Contributions:
0

Search with a ( in the query returns an invalid keywords error message.

We're testing out an enhanced search box which auto completes the products in the site. It has shown up an error / possible bug with our current zencart install itself.

Nearly all our products have a part of the description in brackets. The issue is if any of these brackets have a space between them. For example Call Of Duty ( Wii Pre Owned ) generates an invalid keyword message where as Call Of Duty (Wii Pre Owned) doesn't.

Short of going through a couple of thousand products to delete the spaces between ( and ) entries is there any way of amending the search query not to throw up an invalid keyword error for this scenario ?

Thanks in advance.

28 Sep 2011, 10:48 PM
#2
ksookma avatar

ksookma

Zen Follower

Join Date:
Aug 2009
Posts:
212
Plugin Contributions:
1

Re: Search with a ( in the query returns an invalid keywords error message.

I don't know what the mod is that you are using so im not sure how to help in that regard but i can make one suggestion. Using easy populate you can do find and replace functions in the description column. Good luck:wink:

29 Sep 2011, 5:39 AM
#3
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Search with a ( in the query returns an invalid keywords error message.

PatF:

We're testing out an enhanced search box which auto completes the products in the site. It has shown up an error / possible bug with our current zencart install itself.

Actually, it appears to showing up a bug with whatever is creating the search query. Specifically, the () characters aren't being 'escaped' as they should be.

Shouldn't be too hard to find and fix. What's the actual module you are using called?

Cheers
Rod

29 Sep 2011, 8:01 AM
#4
patf avatar

patf

Zen Follower

Join Date:
May 2008
Posts:
200
Plugin Contributions:
0

Re: Search with a ( in the query returns an invalid keywords error message.

We're testing a mod available at advancebydesign.com/software/zencart-modifications/zencart-add-ons-and-modules/search-box-auto-complete.html but this behaviour appears to be native to zencart itself. I have tested the same search queries on three sites and then on the classic template itself and anything with a ( or ) in the search term throws up the error.

29 Sep 2011, 8:45 AM
#5
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Search with a ( in the query returns an invalid keywords error message.

This warrants further investigation.

Whilst verifying this I've managed to get zencart to produce some results I really wasn't expecting.

Furthermore, whatever the cause, it also has a similar effect with zen150 Beta (at least the version I current have installed).

Cheers
Rod

29 Sep 2011, 8:58 AM
#6
patf avatar

patf

Zen Follower

Join Date:
May 2008
Posts:
200
Plugin Contributions:
0

Re: Search with a ( in the query returns an invalid keywords error message.

Hi Rod,

I was just posting a bug report as you replied. I'm surprised it hasn't come up before. :smile:

29 Sep 2011, 9:22 AM
#7
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Search with a ( in the query returns an invalid keywords error message.

PatF:

Hi Rod,
I'm surprised it hasn't come up before. :smile:

You'd be surprised at how long a bug can remain hidden and/or never reported.

How many** customers **actually search for products with "()" as part of their usual query? Probably not many, and those that do would probably think the error was 'normal'.

Next question is how many merchants perform a search on their own stores products using these same characters? Probably not many at all, and many of those would change the product descriptions rather than report the error.

Did the code developer test/check to see what happens if someone does use this as part of a search query? Maybe, maybe not. Was there reason to?

Should this bug be fixed because it apparently has so little impact in day to day use? This could be open to debate. It depends on who is being affected
:smile:

Good find BTW.
Very few people have the 'privilege' of being the first to report a real bug. 99% of bug reports tend to be either user error, previously reported bugs, or bugs already fixed in later program versions.

Cheers
Rod

29 Sep 2011, 10:04 AM
#8
patf avatar

patf

Zen Follower

Join Date:
May 2008
Posts:
200
Plugin Contributions:
0

Re: Search with a ( in the query returns an invalid keywords error message.

Can't disagree with any of your points Rod. :smile:

I'm hoping it is an easy fix as although I may be one of the few stores effected it's a massive pain in the proverbials to deal with if we want to put in this search mod. We don't use product models so easy populate won't help out on this. Mind you I'm sure there is a query that can be ran on the database table to strip out the space.

29 Apr 2012, 10:43 AM
#9
triumph avatar

triumph

New Zenner

Join Date:
Feb 2010
Posts:
36
Plugin Contributions:
0

Re: Search with a ( in the query returns an invalid keywords error message.

Hi

i think you talk about this:

advancebydesign.com/software/zencart-modifications/zencart-add-ons-and-modules/search-box-auto-complete.html

It's very good contrib!

It's working perfect to me on 1.39h, but there is 1 point to update!

I discovered that if you have multiple products with the same keywords but in a different order, only the results with the words in the same order as the research emerge. I need all the products with the same keywords in any order can emerge!

thanks for you help!