Core Commerce Add product Issue
Permalink
I've suddenly got a problem with a client's Core Commerce store.
They've not needed to add a product since March but tried yesterday and every time we try to add any product even with minimal values we get the error:
mysqli error: [1366: Incorrect decimal value: '' for column 'prWeight' at row 1] in EXECUTE("insert into CoreCommerceProducts (prName, prDescription, prRequiresShipping, prPhysicalGood, prQuantity, prMinimumPurchaseQuantity, prQuantityUnlimited, prQuantityAllowNegative, prStatus, prPrice, prSpecialPrice, prWeight, prWeightUnits, prDimL, prDimW, prDimH, prDimUnits, prRequiresTax, prUseTieredPricing, prRequiresLoginToPurchase, prShippingModifier, prLanguage, prDateAdded) values ( 'Test', '
dgfjhj
', '1', '1', 0, 1, 0, 0, '1', '0', 0, '', 'lb', 0, 0, 0, 'in', '1', 0, 0, '', NULL, '2018-05-25 11:36:43')")
When I play with this in the database it seems the prWeight and prShippingModifier values need to be 0 rather than '' in order for the query to run.
Any idea what might have happened to suddenly cause this issue?
They've not needed to add a product since March but tried yesterday and every time we try to add any product even with minimal values we get the error:
mysqli error: [1366: Incorrect decimal value: '' for column 'prWeight' at row 1] in EXECUTE("insert into CoreCommerceProducts (prName, prDescription, prRequiresShipping, prPhysicalGood, prQuantity, prMinimumPurchaseQuantity, prQuantityUnlimited, prQuantityAllowNegative, prStatus, prPrice, prSpecialPrice, prWeight, prWeightUnits, prDimL, prDimW, prDimH, prDimUnits, prRequiresTax, prUseTieredPricing, prRequiresLoginToPurchase, prShippingModifier, prLanguage, prDateAdded) values ( 'Test', '
dgfjhj
', '1', '1', 0, 1, 0, 0, '1', '0', 0, '', 'lb', 0, 0, 0, 'in', '1', 0, 0, '', NULL, '2018-05-25 11:36:43')")
When I play with this in the database it seems the prWeight and prShippingModifier values need to be 0 rather than '' in order for the query to run.
Any idea what might have happened to suddenly cause this issue?
Thanks @weyboat, it seems that an automatic update to Plesk switched mysql to strict mode!
That also solves a couple of other issues I was seeing.
That also solves a couple of other issues I was seeing.
You are most welcome, Just shows the power of the Concrete5 Forum for solving problems..
Core Commerce can run on a server with MySQL strict as long as you are careful not to leave any edit dialog inputs unspecified. For example, if there is a weight field that is empty and you don't use it, put a 0 (zero) in it before saving.
That can work OK for editing. Perhaps not so convenient if its a product option attribute and end users bump into the problem.
In an ideal world, Core Commerce would be fixed. But I don't see that happening any time soon.
That can work OK for editing. Perhaps not so convenient if its a product option attribute and end users bump into the problem.
In an ideal world, Core Commerce would be fixed. But I don't see that happening any time soon.
Might be worth talking to your server techs