Zen Cart Logo
Forums / Bug Reports / [Done v1.3.9] 1366 Incorrect decimal value: 'f' for column 'value' at row 1

[Done v1.3.9] 1366 Incorrect decimal value: 'f' for column 'value' at row 1

Locked

Views: 12,256

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
9 Dec 2008, 7:36 PM
#1
interskill avatar

interskill

New Zenner

Join Date:
Nov 2008
Posts:
11
Plugin Contributions:
0

[Done v1.3.9] 1366 Incorrect decimal value: 'f' for column 'value' at row 1

1366 Incorrect decimal value: 'f' for column 'value' at row 1
in:
[INSERT INTO zen_orders_total (orders_id, title, text, value, class, sort_order) VALUES ('10', 'Free Shipping:', '£0.00', 'f', 'ot_shipping', '200')]

I receive this error message when testing a downloadable product at step 2 of the checkout (check/money order) as far as I can see I have set all attributes correctly and the product is showing Product is virtual = no always free shipping=no

Can any body help
Please

Thanks

Nigel Carr

11 Dec 2008, 12:42 PM
#2
interskill avatar

interskill

New Zenner

Join Date:
Nov 2008
Posts:
11
Plugin Contributions:
0

Re: [Done v1.3.9] 1366 Incorrect decimal value: 'f' for column 'value' at row 1

Interskill:

1366 Incorrect decimal value: 'f' for column 'value' at row 1
in:
[INSERT INTO zen_orders_total (orders_id, title, text, value, class, sort_order) VALUES ('10', 'Free Shipping:', '£0.00', 'f', 'ot_shipping', '200')]

I receive this error message when testing a downloadable product at step 2 of the checkout (check/money order) as far as I can see I have set all attributes correctly and the product is showing Product is virtual = no always free shipping=no

Can any body help
Please

Thanks

Nigel Carr

Looking through similar threads it appears that the problem may be MYsql running in Strict mode, unfortunaltely I am not able to change or alter the My.INI file as this is protected by our web hosts, can anybody help with a code re-write?
Thanks

14 Dec 2008, 8:11 PM
#3
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,878
Plugin Contributions:
3

Re: [Done v1.3.9] 1366 Incorrect decimal value: 'f' for column 'value' at row 1

Hi,

It is indeed a mysql 5 strict mode bug, although why it uses a 'f' as the value I have no idea.

I don't have a complete fix for this yet, but this workaround should help.

You will need to edit

includes/classes/order.php.

the block of code you are looking for is circa line 623 and looks like this

      $sql_data_array = array('orders_id' => $insert_id,
                              'title' => $zf_ot_modules[$i]['title'],
                              'text' => $zf_ot_modules[$i]['text'],
                              'value' => $zf_ot_modules[$i]['value'],
                              'class' => $zf_ot_modules[$i]['code'],
                              'sort_order' => $zf_ot_modules[$i]['sort_order']);

you should replace that with

      $sql_data_array = array('orders_id' => $insert_id,
                              'title' => $zf_ot_modules[$i]['title'],
                              'text' => $zf_ot_modules[$i]['text'],
         [B]                     'value' => (is_numeric($zf_ot_modules[$i]['value'])) ? $zf_ot_modules[$i]['value'] : '0',[/B]
                              'class' => $zf_ot_modules[$i]['code'],
                              'sort_order' => $zf_ot_modules[$i]['sort_order']);

Make sure you back up the file first before editing, and test on a live server asap after editing.

18 Dec 2008, 10:36 AM
#4
interskill avatar

interskill

New Zenner

Join Date:
Nov 2008
Posts:
11
Plugin Contributions:
0

Re: [Done v1.3.9] 1366 Incorrect decimal value: 'f' for column 'value' at row 1

Brilliant!!!! :clap::clap:

It works - thank you very much..

If I come across any bugs because of the change I will let you know, but for now all is testing out OK..

Thanks Again

14 Jan 2009, 10:45 AM
#5
remoteone avatar

remoteone

Zen Follower

Join Date:
Jan 2009
Location:
Macclesfield, South Australia
Posts:
104
Plugin Contributions:
0

Re: [Done v1.3.9] 1366 Incorrect decimal value: 'f' for column 'value' at row 1

Yes .. this has fixed my problem...Thanks