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?

katalysis
 
ConcreteOwl replied on at Permalink Best Answer Reply
ConcreteOwl
Possibly your server has changed the MySql sql-mode to Strict?
Might be worth talking to your server techs
katalysis replied on at Permalink Reply
katalysis
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.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
You are most welcome, Just shows the power of the Concrete5 Forum for solving problems..
JohntheFish replied on at Permalink Reply
JohntheFish
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.