Try searching for "IF(manufacturers_id" the rest is probably dynamically built.
The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker
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
Last edited by Kevin205; 18 Apr 2013 at 05:14 PM.
Using Zen Cart 1.5.1
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.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
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".
Last edited by lhungil; 18 Apr 2013 at 06:48 PM.
The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker
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.
Last edited by Kevin205; 19 Apr 2013 at 07:39 AM.
Using Zen Cart 1.5.1