Zen Cart Logo
Forums / General Questions / Strange Warning message

Strange Warning message

Views: 3,521

Results 1 to 18 of 18
18 Apr 2013, 1:02 AM
#1
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Strange Warning message

A zen site running 1.5.1 is using a link checker to verify his site's link and on the following urls,

http: //Domain.com/index.php?main_page=products_all&disp_order=1&fltCategory[]=19
http: //Domain.com/index.php?main_page=products_all&disp_order=1&fltCategory[]=20
http: //Domain.com/index.php?main_page=products_new&disp_order=6&fltCategory[]=19
http: //Domain.com/index.php?main_page=products_new&disp_order=6&fltCategory[]=20
http: //Domain.com/index.php?main_page=products_new&disp_order=6&fltPrice[]=128.01--178&fltCategory[]=19
http: //Domain.com/index.php?main_page=products_new&disp_order=6&fltPrice[]=128.01--178&fltCategory[]=20
http: //Domain.com/index.php?main_page=products_new&disp_order=6&fltPrice[]=128.01--178&fltCategory[]=21
http: //Domain.com/index.php?main_page=products_new&disp_order=6&fltPrice[]=128.01--178&fltCategory[]=22
http: //Domain.com/index.php?main_page=products_new&disp_order=6&fltPrice[]=128.01--178&fltCategory[]=23

mostly happening on Category[]=19, 20, 21, 22, & 24

he is getting the following warning on lower left hand corner of the page. And the page shows the header info, left category box and the rest is white.

WARNING: An Error occurred, please refresh the page and try again.
Page displays the same when page is refreshed.

It seems to me the links checker is going through the Dynamic filter (as the [] are seen).

Any one with any ideas?

18 Apr 2013, 1:17 AM
#2
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: Strange Warning message

OK I duplicated the case while using the dynamic filter and selecting New Products or All Products and clicking on any of categories 19, 20, 21, 22, 23 & 24.

I don't know how to move or close this from General Question, as it has to be discussed on Dynamic Filter thread.

18 Apr 2013, 4:07 AM
#4
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: Strange Warning message

DrByte:

http://www.zen-cart.com/content.php?311-warning-an-error-occurred-please-refresh-the-page-and-try-again

As I checked the error log, I guess the question stays here, as it is NOT a Dynamic filter issue!

The error message is as follow:

[17-Apr-2013 20:20:50] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), 'Y', 'N') as flag FROM zen_manufacturers WHERE manufacturers_id IN (24,4,8,13' at line 1 :: SELECT manufacturers_id, manufacturers_name, IF(manufacturers_id IN(), 'Y', 'N') as flag FROM zen_manufacturers WHERE manufacturers_id IN (24,4,8,13,10,23,18,15,16,21,17,20,19,22,12,14) ORDER BY manufacturers_name in /MyPath/includes/classes/db/mysql/query_factory.php on line 120

DrByte, I am lost with this error. Can the tables be fixed?

18 Apr 2013, 4:19 AM
#5
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Strange Warning message

Kevin205:

As I checked the error log, I guess the question stays here, as it is NOT a Dynamic filter issue!

The error message is as follow:

DrByte, I am lost with this error. Can the tables be fixed?
And you have provided virtually no information that would give anyone a clue as to what's going on.. (starting with basic information like what were you doing before this error occurred)

So let me suggest that you take a look at the posting tips (that show above the reply box when you add a post to this site).. Provide the information suggested.. This will help the community to help you..

18 Apr 2013, 4:21 AM
#6
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: Strange Warning message

DrByte understood.

The error log explain something that I don't understand!

18 Apr 2013, 4:22 AM
#7
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: Strange Warning message

DivaVocals:

And you have provided virtually no information that would give anyone a clue as to what's going on.. (starting with basic information like what were you doing before this error occurred)

So let me suggest that you take a look at the posting tips (that show above the reply box when you add a post to this site).. Provide the information suggested.. This will help the community to help you..

Did you read the entire post? If you didn't, then you should.

18 Apr 2013, 5:28 AM
#8
rodg avatar

rodg

Deceased

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

Re: Strange Warning message

Kevin205:

As I checked the error log, I guess the question stays here, as it is NOT a Dynamic filter issue!

I don't know how you came to this conclusion based on the error message provided.
Yes, it may appear the the problem has something more to do with "query_factory.php", but this is only the messenger. The real problem is within the code that calls the query_factory.

Kevin205:

DrByte, I am lost with this error. Can the tables be fixed?

THere is nothing in the error message that suggests the the tables are broken. However, if in doubt, phpMyAdmin (and pretty much any other MySQL administration tool) has options to check and/or repair the DB tables. There is no harm in using these tools, and depending on the cause of the problem, it can indeed solve some issues. Alas, I don't think you'll be as lucky.

I think you were closer to the mark with your dynamic filter diagnosis.

Cheers
Rod

18 Apr 2013, 2:57 PM
#9
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: Strange Warning message

RodG:

I don't know how you came to this conclusion based on the error message provided.
Yes, it may appear the the problem has something more to do with "query_factory.php", but this is only the messenger. The real problem is within the code that calls the query_factory.

THere is nothing in the error message that suggests the the tables are broken. However, if in doubt, phpMyAdmin (and pretty much any other MySQL administration tool) has options to check and/or repair the DB tables. There is no harm in using these tools, and depending on the cause of the problem, it can indeed solve some issues. Alas, I don't think you'll be as lucky.

I think you were closer to the mark with your dynamic filter diagnosis.

Cheers
Rod

Thanks for the info. I will look at my PHPMyadmin to see what tools are available to me. And will let you know if it works.
But as you said I don't think I would be that lucky! :yuck: :censored:

Following is what I have done after a site without any errors:

  1. Installed sitemapXML
  2. Updated/revised the manufacturer's name for some products, and uploaded them using EP4 (through Full-EP_04_10_2013.csv)

After looking at it in detail:
The error only occurs when New Products, /index.php?main_page=products_new and All Products, /index.php?main_page=products_all are selected; and not all categories results in the error, only selecting certain categories causes the error. I am now trying narrow down the category ID numbers. I am guessing the might be numbered (24,4,7,8,13,10,23,18,15,16,21,17,20,19,22,12,14).

Following are a serires of error I am getting as testing:

[18-Apr-2013 07:40:48] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), 'Y', 'N') as flag FROM zen_manufacturers WHERE manufacturers_id IN (24,4,7,8,' at line 1 :: SELECT manufacturers_id, manufacturers_name, IF(manufacturers_id IN(), 'Y', 'N') as flag FROM zen_manufacturers WHERE manufacturers_id IN (24,4,7,8,13,10,23,18,15,16,21,17,20,19,22,12,14) ORDER BY manufacturers_name in /MyPath/includes/classes/db/mysql/query_factory.php on line 120

[18-Apr-2013 07:40:25] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), 'Y', 'N') as flag FROM zen_manufacturers WHERE manufacturers_id IN (24,4,8,13' at line 1 :: SELECT manufacturers_id, manufacturers_name, IF(manufacturers_id IN(), 'Y', 'N') as flag FROM zen_manufacturers WHERE manufacturers_id IN (24,4,8,13,10,23,18,15,16,21,17,20,19,22,12,14) ORDER BY manufacturers_name in /MyPath/includes/classes/db/mysql/query_factory.php on line 120

[18-Apr-2013 07:40:19] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), 'Y', 'N') as flag FROM zen_manufacturers WHERE manufacturers_id IN (24,4,8,13' at line 1 :: SELECT manufacturers_id, manufacturers_name, IF(manufacturers_id IN(), 'Y', 'N') as flag FROM zen_manufacturers WHERE manufacturers_id IN (24,4,8,13,10,23,18,15,16,21,17,20,19,22,12,14) ORDER BY manufacturers_name in /MyPath/includes/classes/db/mysql/query_factory.php on line 120

[18-Apr-2013 07:37:23] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), 'Y', 'N') as flag FROM zen_manufacturers WHERE manufacturers_id IN (24,4,8,13' at line 1 :: SELECT manufacturers_id, manufacturers_name, IF(manufacturers_id IN(), 'Y', 'N') as flag FROM zen_manufacturers WHERE manufacturers_id IN (24,4,8,13,10,23,18,15,16,21,17,20,19,22,12,14) ORDER BY manufacturers_name in /MyPath/includes/classes/db/mysql/query_factory.php on line 120

18 Apr 2013, 3:04 PM
#10
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Strange Warning message

Kevin205:

[17-Apr-2013 20:20:50] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), 'Y', 'N') as flag FROM zen_manufacturers WHERE manufacturers_id IN (24,4,8,13' at line 1 :: SELECT manufacturers_id, manufacturers_name, IF(manufacturers_id IN(), 'Y', 'N') as flag FROM zen_manufacturers WHERE manufacturers_id IN (24,4,8,13,10,23,18,15,16,21,17,20,19,22,12,14) ORDER BY manufacturers_name in /MyPath/includes/classes/db/mysql/query_factory.php on line 120

I am not 100% sure what the part in red is trying to do, but is is the cause of the error. I also did not (with a quick search) find this query in the stock Zen Cart code. You will have to find the code creating that SQL Query, determine what the extra "flag" is for, and adjust the SQL (or code generating the SQL) as appropriate.

**Note: **If it is supposed to add a flag to the SQL result and uses the same condition as the WHERE clause condition... The "flag" can probably be removed from the query and code...

18 Apr 2013, 3:12 PM
#11
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: Strange Warning message

lhungil:

I am not 100% sure what the part in red is trying to do, but is is the cause of the error. I also did not (with a quick search) find this query in the stock Zen Cart code. You will have to find the code creating that SQL Query, determine what the extra "flag" is for, and adjust the SQL (or code generating the SQL) as appropriate.

**Note: **If it is supposed to add a flag to the SQL result and uses the same condition as the WHERE clause condition... The "flag" can probably be removed from the query and code...

I just searched for **IF(manufacturers_id IN(), 'Y', 'N') ** in admin's Developers Tool Kit, in all searches. It did find anything!

18 Apr 2013, 3:14 PM
#12
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Strange Warning message

Try searching for "IF(manufacturers_id" the rest is probably dynamically built.

18 Apr 2013, 3:19 PM
#13
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: Strange Warning message

lhungil:

Try searching for "IF(manufacturers_id" the rest is probably dynamically built.

Ok Found it in

/MyPath/html/includes/templates/MyTemplate/sideboxes/tpl_dynamic_filter.php Line 145

And looking for more.

Yes, that's where its coming from.

18 Apr 2013, 4:11 PM
#14
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: Strange Warning message

Also found the following errors in the logs:

[17-Apr-2013 14:21:44] PHP Warning: array_filter() [<a href='function.array-filter'>function.array-filter</a>]: The first argument should be an array in /MyPath/includes/modules/MyTemplate/dynamic_filter.php on line 15
[17-Apr-2013 14:21:44] PHP Warning: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in /MyPath/includes/templates/MyTemplate/sideboxes/tpl_dynamic_filter.php on line 298
[17-Apr-2013 14:21:44] PHP Warning: array_filter() [<a href='function.array-filter'>function.array-filter</a>]: The first argument should be an array in /MyPath/includes/templates/MyTemplate/sideboxes/tpl_dynamic_filter.php on line 299

[17-Apr-2013 14:52:48] PHP Warning: array_filter() [<a href='function.array-filter'>function.array-filter</a>]: The first argument should be an array in /MyPath/includes/modules/MyTemplate/dynamic_filter.php on line 15
[17-Apr-2013 14:52:48] PHP Warning: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in /MyPath/includes/templates/MyTemplate/sideboxes/tpl_dynamic_filter.php on line 210
[17-Apr-2013 14:52:48] PHP Warning: array_filter() [<a href='function.array-filter'>function.array-filter</a>]: The first argument should be an array in /MyPath/includes/templates/MyTemplate/sideboxes/tpl_dynamic_filter.php on line 239

18 Apr 2013, 5:39 PM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Strange Warning message

lhungil:

IF(manufacturers_id IN(), 'Y', 'N') as flagI am not 100% sure what the part in red is trying to do, but is is the cause of the error. I also did not (with a quick search) find this query in the stock Zen Cart code. You will have to find the code creating that SQL Query, determine what the extra "flag" is for, and adjust the SQL (or code generating the SQL) as appropriate.

**Note: **If it is supposed to add a flag to the SQL result and uses the same condition as the WHERE clause condition... The "flag" can probably be removed from the query and code...

The logic for that part of the query is this: "If the manufacturers_id is in the list denoted by the values contained between the IN () parentheses, then return 'Y', else return 'N' ".
And, since the IN () contains an empty list, the syntax is invalid.

This means that the code that is being used to generate the list to appear between the parentheses is broken, or isn't properly handling a scenario where no such values exist.

18 Apr 2013, 5:44 PM
#16
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Strange Warning message

I'm guessing "/MyPath/includes/modules/MyTemplate/dynamic_filter.php" adds some data to a variable and the line listed is failing... Could be a modification which is different in your templates... Or maybe even a missing setting somewhere...

I'm also guessing the other files use the variable set by "/MyPath/includes/modules/MyTemplate/dynamic_filter.php". As DrByte pointed out these other files are probably may not be checking to see if the variable is set or an array. You might try asking in the support thread for "Dynamic Filter".

19 Apr 2013, 6:34 AM
#17
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: Strange Warning message

lhungil:

I'm guessing "/MyPath/includes/modules/MyTemplate/dynamic_filter.php" adds some data to a variable and the line listed is failing... Could be a modification which is different in your templates... Or maybe even a missing setting somewhere...

I'm also guessing the other files use the variable set by "/MyPath/includes/modules/MyTemplate/dynamic_filter.php". As DrByte pointed out these other files are probably may not be checking to see if the variable is set or an array. You might try asking in the support thread for "Dynamic Filter".

lhungil:

Try searching for "IF(manufacturers_id" the rest is probably dynamically built.

**Issue solved. **

I don’t know whether I should call this a bug with** Dynamic Filter** or just a user error? But I am thinking a lot of people are not interested in placing a Manufacturer‘s name in their product information. This is the problem.

After going through my SQL backups dropping and adding databases on my local server, I got to a series of products, which I had neglected to add the Products Manufacturers name to the product information.

They were all set to -none-. As I picked a Category, and that Category’s product did not have a manufacture name (not defined in the Product Manufacture, and is left as -none-), it resulted in the following error:

[19-Apr-2013 04:29:05 UTC] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), 'Y', 'N') as flag FROM zen_manufacturers WHERE manufacturers_id IN (4,8,13,10' at line 1 :: SELECT manufacturers_id, manufacturers_name, IF(manufacturers_id IN(), 'Y', 'N') as flag FROM zen_manufacturers WHERE manufacturers_id IN (4,8,13,10,11,12,14) ORDER BY manufacturers_name in MyPath\includes\classes\db\mysql\query_factory.php on line 120

So I guess the parenthesis in this if statement “IF(manufacturers_id IN(), 'Y', 'N')“ should contain and is looking for the manufacturer’s name. I think Dynamic Filter should echo an error message or a -none- in the Filter’s By Brand: (manufacturer) side box to notify the shop owner of the potential problem.

Thank you lhungil, DrByte & RodG

ps. This is not a SQL /database problem. I just added the manufacturer name to the table via EP4. So far everything is fine.

This should get posted in the Dynamic Filter thread also. I just don't know how to do it.

19 Apr 2013, 9:39 AM
#18
rodg avatar

rodg

Deceased

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

Re: Strange Warning message

Kevin205:

Issue solved.
<snip>

Thank you lhungil, DrByte & RodG

On behalf of all, we thank you for providing your findings and the solution to the problem. It is sure to help others with a similar issue.

Cheers
Rod