Sylius: [Admin][Product] Unable to add a simple product
At current master, unable to add a product via “New” -> “Simple” due to the fact that position field is null on SQL query, that results in “Cannot be null” error.
request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\NotNullConstraintViolationException: “An exception occurred while executing ‘INSERT INTO sylius_product_variant (code, created_at, updated_at, position, on_hold, on_hand, tracked, width, height, depth, weight, shipping_required, product_id, tax_category_id, shipping_category_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ with params [“testproduct”, “2017-05-25 11:14:28”, “2017-05-25 11:14:28”, null, 0, 0, 0, null, null, null, null, 1, 128, 1, null]: SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘position’ cannot be null” at /var/www/store.dzintars.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 112 {“exception”:“[object] (Doctrine\DBAL\Exception\NotNullConstraintViolationException(code: 0): An exception occurred while executing ‘INSERT INTO sylius_product_variant (code, created_at, updated_at, position, on_hold, on_hand, tracked, width, height, depth, weight, shipping_required, product_id, tax_category_id, shipping_category_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ with params ["testproduct", "2017-05-25 11:14:28", "2017-05-25 11:14:28", null, 0, 0, 0, null, null, null, null, 1, 128, 1, null]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘position’ cannot be null at /var/www/store.dzintars.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:112, Doctrine\DBAL\Driver\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘position’ cannot be null at /var/www/store.dzintars.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:93, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘position’ cannot be null at /var/www/store.dzintars.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91)”} []
This should have some default value probably.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 18 (10 by maintainers)
@psihius Can you provide a behat scenario which fails? I would be much easier to tackle a problem.