Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2006
    Posts
    191
    Plugin Contributions
    0

    Default Zen Cart 1.3.9f - 1366 Incorrect integer value : products_virtual

    Hi there,

    I am running:
    Zen Cart 1.3.9f
    Database Patch Level: 1.3.9b
    v1.3.9b [2010-05-18 18:34:34] (Version Update 1.3.8->1.3.9b)
    v1.3.8 [2008-07-30 02:07:56] (Fresh Installation)
    MySQL 5.5.21
    PHP Version: 5.2.17

    This is the first time I have tried adding a "Document - General" product type. Inserting it causes the error pasted below.

    From forum searches I am led to believe the issue is in:
    /admin/includes/modules/update_product.php

    I have tested DrByte's fix from this thread, but the result is the same:
    http://www.zen-cart.com/showthread.p...oducts_virtual

    I have also tested the same file from 1.3.9h and got the same error.

    Is there something I can do to make this work?
    Thanks for any advice on this.
    Regards
    Rob


    1366 Incorrect integer value: '' for column 'products_priced_by_attribute' at row 1
    in:
    [insert into products (products_quantity, products_type, products_model, products_price, products_date_available, products_weight, products_status, products_virtual, products_tax_class_id, manufacturers_id, products_quantity_order_min, products_quantity_order_units, products_priced_by_attribute, product_is_free, product_is_call, products_quantity_mixed, product_is_always_free_shipping, products_qty_box_status, products_quantity_order_max, products_sort_order, products_discount_type, products_discount_type_from, products_price_sorter, products_image, products_date_added, master_categories_id) values ('0', '3', '', '0', null, '0', '1', '0', '0', '0', '1', '1', '', '0', '0', '', '0', '', '', '0', '0', '0', '0', '', now(), '216')]
    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.

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: Zen Cart 1.3.9f - 1366 Incorrect integer value : products_virtual

    If we analyse the INPUTS, we get:

    products_quantity, '0',
    products_type, '3',
    products_model, '',
    products_price, '0',
    products_date_available, null,
    products_weight, '0',
    products_status, '1',
    products_virtual, '0',
    products_tax_class_id, '0',
    manufacturers_id, '0',
    products_quantity_order_min, '1',
    products_quantity_order_units, '1',
    products_priced_by_attribute, '',
    product_is_free, '0',
    product_is_call, '0',
    products_quantity_mixed, '',
    product_is_always_free_shipping, '0',
    products_qty_box_status, '',
    products_quantity_order_max, '',
    products_sort_order, '0',
    products_discount_type, '0',
    products_discount_type_from, '0',
    products_price_sorter, '0',
    products_image, '',
    products_date_added, now(),
    master_categories_id, '216'


    products_priced_by_attribute, '', Is the first instance of this falling over, because an integer is expected, but no value is given.

    It is likely that when this is fixed, the NEXT instance of an expected integer value which is empty is:
    products_quantity_mixed, '', (INTEGER IS EXPECTED)

    ... and then:
    products_qty_box_status, '', (INTEGER IS EXPECTED)

    ...whereas:
    products_image, '', (This field is VARCHAR, so being empty does not matter).

    So... MAYBE if you add the three expected integers via Dr Byte's suggested fix...

    Code:
    // Data-cleaning to prevent MySQL5 data-type mismatch errors:
        $tmp_value = zen_db_prepare_input($_POST['products_quantity']);
        $products_quantity = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
        $tmp_value = zen_db_prepare_input($_POST['products_price']);
        $products_price = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
        $tmp_value = zen_db_prepare_input($_POST['products_weight']);
        $products_weight = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
        $tmp_value = zen_db_prepare_input($_POST['manufacturers_id']);
        $manufacturers_id = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
        $tmp_value = zen_db_prepare_input($_POST['products_priced_by_attribute']);
        $products_priced_by_attribute = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
        $tmp_value = zen_db_prepare_input($_POST['products_quantity_mixed']);
        $products_quantity_mixed = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
        $tmp_value = zen_db_prepare_input($_POST['products_qty_box_status']);
        $products_qty_box_status = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
    
        $sql_data_array = array('products_quantity' => $products_quantity,
                                'products_type' => zen_db_prepare_input($_GET['product_type']),
                                'products_model' => zen_db_prepare_input($_POST['products_model']),
                                'products_price' => $products_price,
                                'products_date_available' => $products_date_available,
                                'products_weight' => $products_weight,
                                'products_status' => zen_db_prepare_input((int)$_POST['products_status']),
                                'products_virtual' => zen_db_prepare_input((int)$_POST['products_virtual']),
                                'products_tax_class_id' => zen_db_prepare_input((int)$_POST['products_tax_class_id']),
                                'manufacturers_id' => $manufacturers_id,
                                'products_quantity_order_min' => zen_db_prepare_input($_POST['products_quantity_order_min']),
                                'products_quantity_order_units' => zen_db_prepare_input($_POST['products_quantity_order_units']),
                                'products_priced_by_attribute' => zen_db_prepare_input($_POST['products_priced_by_attribute']),
                                'product_is_free' => zen_db_prepare_input((int)$_POST['product_is_free']),
                                'product_is_call' => zen_db_prepare_input((int)$_POST['product_is_call']),
                                'products_quantity_mixed' => zen_db_prepare_input($_POST['products_quantity_mixed']),
                                'product_is_always_free_shipping' => zen_db_prepare_input((int)$_POST['product_is_always_free_shipping']),
                                'products_qty_box_status' => zen_db_prepare_input($_POST['products_qty_box_status']),
                                'products_quantity_order_max' => zen_db_prepare_input($_POST['products_quantity_order_max']),
                                'products_sort_order' => (int)zen_db_prepare_input($_POST['products_sort_order']),
                                'products_discount_type' => zen_db_prepare_input($_POST['products_discount_type']),
                                'products_discount_type_from' => zen_db_prepare_input($_POST['products_discount_type_from']),
                                'products_price_sorter' => zen_db_prepare_input($_POST['products_price_sorter'])
                                );
    20 years a Zencart User

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

    Default Re: Zen Cart 1.3.9f - 1366 Incorrect integer value : products_virtual

    Quote Originally Posted by robax View Post
    1366 Incorrect integer value: '' for column 'products_priced_by_attribute' at row 1
    Note that your error message was referring to the products_priced_by_attribute field, not products_virtual.

    Schoolboy is correct.
    but this is a simpler fix, and will be included in v1.6.0:
    Fix:
    Code:
          'products_priced_by_attribute' => zen_db_prepare_input((int)$_POST['products_priced_by_attribute']),
    .

    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.

 

 

Similar Threads

  1. v154 Issue with Authorize.net AIM updating table - error 1366 incorrect integer value
    By inklingsolutions in forum Built-in Shipping and Payment Modules
    Replies: 48
    Last Post: 29 Dec 2016, 09:09 PM
  2. 1366 Incorrect integer value Problems with MySQL 5 strict-mode
    By Max70 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 13
    Last Post: 10 Dec 2009, 07:11 PM
  3. Replies: 4
    Last Post: 18 Jul 2009, 04:46 PM
  4. Replies: 4
    Last Post: 14 Jan 2009, 11:45 AM
  5. Incorrect integer value
    By garybook in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 14 Sep 2007, 05:52 PM

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