Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2008
    Posts
    54
    Plugin Contributions
    0

    Default PHP Fatal error: 1366:Incorrect decimal value after upgrade to 1.5.6

    Hi guys,

    Iīm stuck here...

    after upgrade to 1.5.6a (from 1.5.4) I have noticed a problem which I cannot solve.

    When trying to update a product or add one, I recieve this message:

    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.

    after looking to my logs, it seems that there is some problem with products_price in database and incorrect decimal value:

    [21-Dec-2019 21:11:05 UTC] Request URI: /admin/product.php?cPath=62&pID=1198&action=update_product, IP address: xxx
    #1 trigger_error() called at [/home/xxx/public_html/includes/classes/db/mysql/query_factory.php:171]
    #2 queryFactory->show_error() called at [/home/xxxx/public_html/includes/classes/db/mysql/query_factory.php:143]
    #3 queryFactory->set_error() called at [/home/xxxx/public_html/includes/classes/db/mysql/query_factory.php:270]
    #4 queryFactory->Execute() called at [/home/xxxx/public_html/admin/includes/functions/database.php:51]
    #5 zen_db_perform() called at [/home/xxxx/public_html/admin/includes/modules/update_product.php:83]
    #6 require(/home/xxxx/public_html/admin/includes/modules/update_product.php) called at [/home/xxxx/public_html/admin/product.php:34]
    --> PHP Fatal error: 1366:Incorrect decimal value: '53,9167' for column 'products_price' at row 1 :: update products set products_quantity = '12', products_type = '1', products_model = 'code', products_price = '53,9167', products_date_available = null, products_weight = '0', products_status = '1', products_virtual = '0', products_tax_class_id = '1', manufacturers_id = '0', products_quantity_order_min = '1', products_quantity_order_units = '1', products_priced_by_attribute = '0', product_is_free = '0', product_is_call = '0', products_quantity_mixed = '1', product_is_always_free_shipping = '0', products_qty_box_status = '1', products_quantity_order_max = '0', products_sort_order = '0', products_discount_type = '0', products_discount_type_from = '0', products_price_sorter = '53,9167', products_image = 'image.jpg', products_last_modified = now(), master_categories_id = '62' where products_id = 1198 ==> (as called by) /home/xxxx/public_html/admin/includes/functions/database.php on line 51 <== in /home/xxxx/public_html/includes/classes/db/mysql/query_factory.php on line 171.

    my other eshops based on 1.5.4 are fully functional on the same server,

    I use PHP 7.2.25 and MySQL 5.6.45

    Any idea, please, what went wrong here? I recieve this message on both e-shops I have upgraded to 1.5.6a (actually, one of them is already on 1.5.6c - I didnīt realized this problem before another upgrade)

  2. #2
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: PHP Fatal error: 1366:Incorrect decimal value after upgrade to 1.5.6

    The numbers need to have/use a dot for the decimal when storing such a number. Perhaps the previous store(s) were modified to do this or handle it differently, but a decimal number should not include a thousands separator and should be stored with a period for the decimal such that the product's price should be entered as '53.9167' instead of '53,9167'.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Sep 2008
    Posts
    54
    Plugin Contributions
    0

    Default Re: PHP Fatal error: 1366:Incorrect decimal value after upgrade to 1.5.6

    Thanks for trying to help, mc12345678,

    problem is these prices are stored in db with a dot and I see them in the admin with a dot...

    I can update a product directly through db without problems,

    stores didnīt have this problem before the upgrade - I updated products regularly...

    Could you please point me where should I look?
    Last edited by Doomm; 22 Dec 2019 at 08:46 AM.

  4. #4
    Join Date
    Sep 2008
    Posts
    54
    Plugin Contributions
    0

    Default Re: PHP Fatal error: 1366:Incorrect decimal value after upgrade to 1.5.6

    Update - now I found that problem is somehow related to languages - everything works fine in english, problem is when I change the languate to another one (slovak in my case). Will work on that and try what I did wrong :-)

  5. #5
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: PHP Fatal error: 1366:Incorrect decimal value after upgrade to 1.5.6

    I am thinking that perhaps there is javascript associated with the page changes that may/may not have been involved with this. I'm not entirely sure how the selection of the current currency is incorporated into the step through process of storing a product but it seems to me that it only occurs in one place to display the value not to store it.

    Perhaps could also explain how the site was upgraded? There were some significant changes that could possibly explain a discrepancy occurring.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Sep 2008
    Posts
    54
    Plugin Contributions
    0

    Default Re: PHP Fatal error: 1366:Incorrect decimal value after upgrade to 1.5.6

    Itīs true that sites were not updated exactly by the book - I just uploaded all new files, updated db through zc_install and one by one updated all plugins (there are only a few ones),

    whatīs confusing for me is that I donīt have this problem when I switch the site to english - Iīll investigate this further and will post if Iīll find the answer.

  7. #7
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: PHP Fatal error: 1366:Incorrect decimal value after upgrade to 1.5.6

    Quote Originally Posted by Doomm View Post
    Itīs true that sites were not updated exactly by the book - I just uploaded all new files, updated db through zc_install and one by one updated all plugins (there are only a few ones),

    whatīs confusing for me is that I donīt have this problem when I switch the site to english - Iīll investigate this further and will post if Iīll find the answer.
    When you say that you just uploaded all new files, was that to an empty directory or did these files overwrite existing files?

    Each language has its own definition of how to handle numbers and whether to use a comma for the decimal separator, period or some other character. What I was looking at and for was any handler that would operate on the data either downloaded from the database or manually entered.

    One possibility of where the issue appears may be in the admin sanitizer if it is locale aware. Thing is, I know there are some others that operate in alternate languages where the language uses a comma for the decimal point but has been able to "work around" this issue if it is in fact something central to the core code.

    So, what other plugins are installed and/or language(s) used?

    And still have the question from above about uploading new files to a new empty directory or did the files overwrite existing files?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    Sep 2008
    Posts
    54
    Plugin Contributions
    0

    Default Re: PHP Fatal error: 1366:Incorrect decimal value after upgrade to 1.5.6

    I found it,

    problem was in line 24 in the main language file in admin (slovak.php in my case). This was my old line:

    setlocale(LC_ALL, "sk_SK.utf-8");

    after copying it from the actual english.php file to:

    @setlocale(LC_TIME, $locales);

    everything seems to be working correctly.

    Actually, I have changed also line before from english.php:

    $locales = array('en_US', 'en_US.utf8', 'en', 'English_United States.1252');
    @setlocale(LC_TIME, $locales);

    to slovak.php:

    $locales = array('sk_SK', 'sk_SK.utf8', 'sk', 'Slovak_Slovakia.1250');
    @setlocale(LC_TIME, $locales);

    not sure what this change really means, but as I said, it works fine.

    Just a few comments, maybe they will be handy for someone:

    - yes, in the slovak language, itīs used comma instead of dot in numbers (not sure though how this is linked to language file)
    - I didnīt change language files immediately after update, never happened this problem to me before, now Iīll think about it right away
    - yes these uploaded files overrride old files on the server. (Obviously, it overrides also english language files, not slovak ones)

    All in all, I hope this is it. Mc12345678 you have helped me a lot to find the right path, thank you very much for your time and effort. Community here is the main reason why Iīm still with Zencart after all those years. Thanks again, buddy.

 

 

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. Replies: 2
    Last Post: 22 Jun 2013, 03:48 AM
  3. Replies: 4
    Last Post: 14 Jan 2009, 11:45 AM
  4. 1366 Incorrect string value: 'zone_name'
    By technologist in forum Installing on a Windows Server
    Replies: 2
    Last Post: 9 Jul 2008, 04:17 PM
  5. VAT error message (1366 Incorrect decimal value)
    By Typhoon in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 5
    Last Post: 18 Jul 2006, 11:32 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