Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2007
    Location
    Illinois, USA
    Posts
    312
    Plugin Contributions
    0

    Default Copy Attributes to Category Error

    1.5.7b
    php7.3

    When copying a set of attributes to another category, I received the following screen error:
    "WARNING: An Error occurred, please refresh the page and try again.If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields."

    and error log:
    Code:
    [21-Jan-2021 11:24:43 America/Chicago] Request URI:  /XXXXX/index.php?cmd=attributes_controller&action=update_attributes_copy_to_category,  IP address: XXXXX
    #1  trigger_error() called at [/includes/classes/db/mysql/query_factory.php:170]
    #2  queryFactory->show_error() called at [/includes/classes/db/mysql/query_factory.php:142]
    #3  queryFactory->set_error() called at [/includes/classes/db/mysql/query_factory.php:269]
    #4  queryFactory->Execute() called at [/XXXXX/includes/functions/general.php:2188]
    #5  zen_copy_products_attributes() called at [/XXXXX/attributes_controller.php:587]
    #6  require(/XXXXX/attributes_controller.php) called at [/XXXXX/index.php:11]
    --> PHP Fatal error: 1064:You have an error in your SQL syntax; check  the manual that corresponds to your MariaDB server version for the  right syntax to use near ''0
                  WHERE products_id=3009
                   AND options_id= 328
      ...' at line 24 :: UPDATE products_attributes set
                  options_values_price='0.0000',
                  price_prefix='',
                  products_options_sort_order='0',
                  product_attribute_is_free='0',
                  products_attributes_weight='0',
                  products_attributes_weight_prefix='',
                  attributes_display_only='0',
                  attributes_default='1',
                  attributes_discounted='0',
                  attributes_image='',
                  attributes_price_base_included='0',
                  attributes_price_onetime='0.0000',
                  attributes_price_factor='0.0000',
                  attributes_price_factor_offset='0.0000',
                  attributes_price_factor_onetime='0.0000',
                  attributes_price_factor_onetime_offset='0.0000',
                  attributes_qty_prices='',
                  attributes_qty_prices_onetime='',
                  attributes_price_words='0.0000',
                  attributes_price_words_free='0',
                  attributes_price_letters='0.0000',
                  attributes_price_letters_free='0',
                  attributes_required='0
                  WHERE products_id=3009
                   AND options_id= 328
                   AND options_values_id=1289 ==> (as called by)  /00java00/includes/functions/general.php on line 2188 <== in  /includes/classes/db/mysql/query_factory.php on line 170.
    NTO: building a better network thru collaboration
    www.needtoorder.com | www.coffeewitheinstein.com

  2. #2
    Join Date
    Jan 2007
    Location
    Illinois, USA
    Posts
    312
    Plugin Contributions
    0

    Default Re: Copy Attributes to Category Error

    Though it gave the warning... it did complete the task of copying the attributes...
    NTO: building a better network thru collaboration
    www.needtoorder.com | www.coffeewitheinstein.com

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,475
    Plugin Contributions
    88

    Default Re: Copy Attributes to Category Error


  4. #4
    Join Date
    Jan 2007
    Location
    Illinois, USA
    Posts
    312
    Plugin Contributions
    0

    Default Re: Copy Attributes to Category Error

    Quote Originally Posted by lat9 View Post
    I made the change to the general.php file -- THANK YOU!

    I also noticed, and this wasn't corrected with the above fix and may be unrelated, when attempting to go directly to the Attributes controller thru the catalog drop down, it loads the default category but none of the products in the category.
    Click image for larger version. 

Name:	screen1.jpg 
Views:	38 
Size:	20.5 KB 
ID:	19387

    If I click on next product, I receive at this link: /index.php?cmd=attributes_controller&products_filter=0&current_category_id=535

    **UPDATE: ONLY DOES THIS WITH THIS CATEGORY... Checking into database.
    Click image for larger version. 

Name:	screen2.jpg 
Views:	32 
Size:	10.2 KB 
ID:	19388

    If i go directly to the category, you can see the products:
    Click image for larger version. 

Name:	screen3.jpg 
Views:	30 
Size:	22.1 KB 
ID:	19389

    And if I click on the Attributes button for the product, I then can see the full attributes:
    Click image for larger version. 

Name:	screen5.jpg 
Views:	28 
Size:	21.2 KB 
ID:	19390

    The Copy Options to whole category NOW works without error.
    Last edited by Carbonless; 21 Jan 2021 at 07:17 PM. Reason: UPDATE
    NTO: building a better network thru collaboration
    www.needtoorder.com | www.coffeewitheinstein.com

  5. #5
    Join Date
    Jan 2007
    Location
    Illinois, USA
    Posts
    312
    Plugin Contributions
    0

    Default Re: Copy Attributes to Category Error

    FIXED!!

    Not sure what the issue was... but moved products to a new category, deleted the problematic category, and all is functioning as it should.
    NTO: building a better network thru collaboration
    www.needtoorder.com | www.coffeewitheinstein.com

  6. #6
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Copy Attributes to Category Error

    Quote Originally Posted by Carbonless View Post
    I made the change to the general.php file -- THANK YOU!

    I also noticed, and this wasn't corrected with the above fix and may be unrelated, when attempting to go directly to the Attributes controller thru the catalog drop down, it loads the default category but none of the products in the category.
    Click image for larger version. 

Name:	screen1.jpg 
Views:	38 
Size:	20.5 KB 
ID:	19387

    If I click on next product, I receive at this link: /index.php?cmd=attributes_controller&products_filter=0&current_category_id=535

    **UPDATE: ONLY DOES THIS WITH THIS CATEGORY... Checking into database.
    Click image for larger version. 

Name:	screen2.jpg 
Views:	32 
Size:	10.2 KB 
ID:	19388

    If i go directly to the category, you can see the products:
    Click image for larger version. 

Name:	screen3.jpg 
Views:	30 
Size:	22.1 KB 
ID:	19389

    And if I click on the Attributes button for the product, I then can see the full attributes:
    Click image for larger version. 

Name:	screen5.jpg 
Views:	28 
Size:	21.2 KB 
ID:	19390

    The Copy Options to whole category NOW works without error.
    I'm trying to look into the possibilities that could have caused this newly described issue (suspecting that there is/was information in the database that led to this issue), but I'm having difficulty understanding the starting point(s) and process taken to get to the "blank page"... I do believe I recently have seen a similar result that I found surprising but at the same time I know a lot has been changed and so wasn't yet "worried" about it... :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Jan 2007
    Location
    Illinois, USA
    Posts
    312
    Plugin Contributions
    0

    Default Re: Copy Attributes to Category Error

    I traced it to a database issue. Somehow, category titles were removed from the databse, but the subcategories were still tied to the main category. It's possible I could have deleted something, but not likely, it was a fresh install with a database import, and the import could have been less than 100% successful.

    The error was happening when attempting to pull up a category to copy options to that had a parent category with no name, once again, not sure how that happened.
    NTO: building a better network thru collaboration
    www.needtoorder.com | www.coffeewitheinstein.com

  8. #8
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Copy Attributes to Category Error

    Quote Originally Posted by Carbonless View Post
    I traced it to a database issue. Somehow, category titles were removed from the databse, but the subcategories were still tied to the main category. It's possible I could have deleted something, but not likely, it was a fresh install with a database import, and the import could have been less than 100% successful.

    The error was happening when attempting to pull up a category to copy options to that had a parent category with no name, once again, not sure how that happened.
    Ok, but if I understood correctly in using two different "ways" to get to the same category, one showed eveything expected, the other did not. That difference is important and by me (maybe someone else understands) I don't. I would like to understand though...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Copy Attributes to Category Error

    Btw, I wouldn't think that any of the queries associated would fail because the name itself didn't exist... to me it seems like there may be something else... I say that from the perspective that there is/was a record entry for the category description, but the categories name was empty. Not that the category didn't have a description record even though I would think (again somewhat guessing here because of the missing information of which query(ies) were involved) that the description would be left joined and that there wouldn't be anything that would prohibit the display of the remainder of the associated information...

    But like I said before, a lot has changed in this area of code so not sure yet what may have contributed to the issue.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Replies: 4
    Last Post: 3 Jan 2019, 11:32 PM
  2. v139h copy attributes to a category - drop down limited to 72 categories - I have more?
    By SarahL in forum Customization from the Admin
    Replies: 4
    Last Post: 27 Jun 2012, 03:00 PM
  3. Replies: 3
    Last Post: 9 Aug 2009, 09:04 PM
  4. Copy Product without attributes still copies the attributes
    By oavs in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 29 Apr 2008, 11:30 PM
  5. error when copy all attributes
    By JonathanBe in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 4 Dec 2007, 05:15 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