Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18
  1. #11
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Strange Warning message

    Quote Originally Posted by lhungil View Post
    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!
    Using Zen Cart 1.5.1

  2. #12
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Strange Warning message

    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

  3. #13
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Strange Warning message

    Quote Originally Posted by lhungil View Post
    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.
    Last edited by Kevin205; 18 Apr 2013 at 04:23 PM.
    Using Zen Cart 1.5.1

  4. #14
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default 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
    Last edited by Kevin205; 18 Apr 2013 at 05:14 PM.
    Using Zen Cart 1.5.1

  5. #15
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Strange Warning message

    Quote Originally Posted by lhungil View Post
    IF(manufacturers_id IN(), 'Y', 'N') as flag
    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...
    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.

  6. #16
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default 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".
    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

  7. #17
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Strange Warning message

    Quote Originally Posted by lhungil View Post
    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".
    Quote Originally Posted by lhungil View Post
    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.
    Last edited by Kevin205; 19 Apr 2013 at 07:39 AM.
    Using Zen Cart 1.5.1

  8. #18
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Strange Warning message

    Quote Originally Posted by Kevin205 View Post
    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

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v151 Strange behavior with Warning: Low Stock email
    By woodlandsprite in forum General Questions
    Replies: 3
    Last Post: 28 Nov 2012, 03:51 AM
  2. strange cookie error message
    By maclean in forum Basic Configuration
    Replies: 1
    Last Post: 10 Jul 2007, 06:09 AM
  3. Strange ini settings warning
    By mattys in forum General Questions
    Replies: 0
    Last Post: 19 Dec 2006, 12:11 PM
  4. Strange error message
    By strelitzia in forum General Questions
    Replies: 5
    Last Post: 2 Nov 2006, 06:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg