Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default *[Done v1.6.0] Attributes controller fatal error after upgrade

    Following upgrade to v1.51 I get the following error:

    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 'int)PRODUCTS_OPTIONS_VALUES_TEXT_ID, 1, 'TEXT')' at line 1 :: INSERT INTO products_options_values (products_options_values_id, language_id, products_options_values_name) VALUES ((int)PRODUCTS_OPTIONS_VALUES_TEXT_ID, 1, 'TEXT') in /home/myserver/public_html/mydomain.com/includes/classes/db/mysql/query_factory.php on line 120

    when accessing either:

    attributes controller
    option names manager
    option values manager

    If I temporarily use the v1.50 php files for these 3 sources the problem does not occur. Looking at the difference between the two versions I think that v1.51 is checking for and finding errors in the database that v1.50 could not.

    Any clue to where I should be looking is appreciated.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Attributes controller fatal error after upgrade

    Make the following changes:

    Line 40:
    /your_secret_admin_dir/attributes controller.php
    Code:
        if ((int)$languages[$i]['id'] > 0 && !in_array((int)$languages[$i]['id'], $ary)) {
    //      $db->Execute("INSERT INTO products_options_values (products_options_values_id, language_id, products_options_values_name) VALUES ((int)PRODUCTS_OPTIONS_VALUES_TEXT_ID, " . (int)$languages[$i]['id'] . ", 'TEXT')");
          $db->Execute("INSERT INTO " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) VALUES (" . (int)PRODUCTS_OPTIONS_VALUES_TEXT_ID . ", " . (int)$languages[$i]['id'] . ", 'TEXT')");
        }
    line 23:
    /your_secret_admin_dir/option names manager.php
    Code:
        if ((int)$languages[$i]['id'] > 0 && !in_array((int)$languages[$i]['id'], $ary)) {
    //      $db->Execute("INSERT INTO products_options_values (products_options_values_id, language_id, products_options_values_name) VALUES ((int)PRODUCTS_OPTIONS_VALUES_TEXT_ID, " . (int)$languages[$i]['id'] . ", 'TEXT')");
          $db->Execute("INSERT INTO " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) VALUES (" . (int)PRODUCTS_OPTIONS_VALUES_TEXT_ID . ", " . (int)$languages[$i]['id'] . ", 'TEXT')");
        }
    line 28:
    /your_secret_admin_dir/option values manager.php
    Code:
        if ((int)$languages[$i]['id'] > 0 && !in_array((int)$languages[$i]['id'], $ary)) {
    //      $db->Execute("INSERT INTO products_options_values (products_options_values_id, language_id, products_options_values_name) VALUES ((int)PRODUCTS_OPTIONS_VALUES_TEXT_ID, " . (int)$languages[$i]['id'] . ", 'TEXT')");
          $db->Execute("INSERT INTO " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) VALUES (" . (int)PRODUCTS_OPTIONS_VALUES_TEXT_ID . ", " . (int)$languages[$i]['id'] . ", 'TEXT')");
        }
    NOTE: Moved to Bug Reports
    Last edited by DrByte; 16 Oct 2012 at 09:13 PM. Reason: fixed tablenames so prefixes work
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default Re: Attributes controller fatal error after upgrade

    That's it, all seems ok now.

    Cheers

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Attributes controller fatal error after upgrade

    Thanks for the update that this worked for you ...

    It is one of those little typos on a built in fix to the database for a check of a missing record, and this bug will not affect very many many people at all, as they have no reason for this fix to run ...

    Glad that you are set now ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Aug 2005
    Location
    Bondi, Australia
    Posts
    100
    Plugin Contributions
    0

    Default Re: Attributes controller fatal error after upgrade

    Works for me - just in time too!

  6. #6
    Join Date
    Mar 2006
    Posts
    477
    Plugin Contributions
    0

    Default Re: Attributes controller fatal error after upgrade

    i did this and now i get this

    [14-Oct-2012 18:23:34] PHP Fatal error: 1062uplicate entry '0-1' for key 'PRIMARY' :: INSERT INTO products_options_values (products_options_values_id, language_id, products_options_values_name) VALUES (0, 1, 'TEXT') /public_html/includes/classes/db/mysql/query_factory.php on line 120
    We sell ATV, Dirtbike, Streetbike, Snowmobile, Watercraft & Custom stickers & Banners. Check us out www.AD-DiscountPerformance.com

  7. #7
    Join Date
    Dec 2006
    Location
    Hudson Valley, New York USA
    Posts
    93
    Plugin Contributions
    0

    Default Re: Attributes controller fatal error after upgrade

    Just wanted to add that Ajeh's original fixes for the 3 files worked for me.

  8. #8
    Join Date
    Mar 2006
    Posts
    477
    Plugin Contributions
    0

    Default Re: Attributes controller fatal error after upgrade

    I want to bring something up i have a prefix zen_ so does that mean this file is looking in the wrong section??
    We sell ATV, Dirtbike, Streetbike, Snowmobile, Watercraft & Custom stickers & Banners. Check us out www.AD-DiscountPerformance.com

  9. #9
    Join Date
    Mar 2006
    Posts
    477
    Plugin Contributions
    0

    Default Re: Attributes controller fatal error after upgrade

    Quote Originally Posted by lucidlee View Post
    Works for me - just in time too!
    ok so where did i go wrong?

    did i mess up the input of the code as shown above or is all that correct?
    We sell ATV, Dirtbike, Streetbike, Snowmobile, Watercraft & Custom stickers & Banners. Check us out www.AD-DiscountPerformance.com

  10. #10
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Attributes controller fatal error after upgrade

    Argh.

    There's another bug. The original fix didn't take table-prefixes into account.

    The fix is now included in Ajeh's post earlier: http://www.zen-cart.com/showthread.p...32#post1153132

    This situation didn't show up in initial testing because the testing database didn't have two sets of data in it like Dashizna's does. (you should clean that up, BTW)
    .

    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.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 5
    Last Post: 21 Mar 2016, 09:45 PM
  2. v139h Fatal Error after upgrade
    By csaling in forum Upgrading from 1.3.x to 1.3.9
    Replies: 5
    Last Post: 25 May 2012, 04:47 PM
  3. 1.3.6 Fatal Error at checkout after upgrade - help please
    By jeffmic in forum Upgrading from 1.3.x to 1.3.9
    Replies: 13
    Last Post: 30 Jan 2007, 12:25 PM
  4. Fatal error after upgrade to 1.3.5 renaming phpbb file
    By mikey1719 in forum Upgrading from 1.3.x to 1.3.9
    Replies: 10
    Last Post: 8 Sep 2006, 01:54 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR