chesh74uk Posted April 23, 2017 Share Posted April 23, 2017 (edited) Hi, Self hosted 1.6.1.11, the shop has been working fine until I tried to create a new product combination with the generator I get this SQL error: Column 'default_on' cannot be null INSERT INTO `ps_product_attribute` (`id_product`, `location`, `ean13`, `upc`, `quantity`, `reference`, `supplier_reference`, `wholesale_price`, `price`, `ecotax`, `weight`, `unit_price_impact`, `minimal_quantity`, `default_on`, `available_date`) VALUES ('51', '', '', '', '0', '1', '', '0', '0', '0', '0', '0', '1', NULL, '0000-00-00') Looking at the SQL, the default_on column does not allow NULL, however the Prestashop code seems to be trying to add this in the VALUES. This is despite adding any values in the default reference field. Also the 'available_date' column also appears to have an incorrect value of '0000-00-00' <EDIT> Upgraded to 1.6.1.12 - SQL error not appearing, however it is only generating one product from any combination...</EDIT> Any help most welcome. Many thanks Edited April 23, 2017 by chesh74uk (see edit history) Link to comment Share on other sites More sharing options...
chesh74uk Posted May 22, 2017 Author Share Posted May 22, 2017 Finally got this sorted and no thanks to the removal of the easy debugging in the latest version. Fixed by amending the default_on field in the database to allow null in the following database tables: ps_product_attribute-shop ps_product_atttribute Link to comment Share on other sites More sharing options...
musicmaster Posted May 23, 2017 Share Posted May 23, 2017 This looks like an upgrade gone wrong. In 1.6.0 and older this value can be 0 or 1. In Prestashop 1.6.1 and newer it can be NULL and 1. In 1.6.1 and higher. And there is also an unique index that take care that each product can only have one default. That unique index will be violated by two zero's but not by two NULLs. There are a lot of similar changes in 1.6.1. They are speed optimizations. Link to comment Share on other sites More sharing options...
dmolina Posted June 21, 2019 Share Posted June 21, 2019 On 5/22/2017 at 8:52 PM, chesh74uk said: Finally got this sorted and no thanks to the removal of the easy debugging in the latest version. Fixed by amending the default_on field in the database to allow null in the following database tables: ps_product_attribute-shop ps_product_atttribute Wooow, thank you very much!! It worked like a charm!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now