If the price amount is left empty on Product Variation inline entity form, then the site will become WSOD.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 2671050-4.patch | 489 bytes | skyredwang |
If the price amount is left empty on Product Variation inline entity form, then the site will become WSOD.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 2671050-4.patch | 489 bytes | skyredwang |
Comments
Comment #2
skyredwangPatch is attached
Comment #3
skyredwangClear the spacing in the previous patch
Comment #4
bojanz commentedWhat's the actual error that's reported?
Comment #5
skyredwangThe actual error is:
Uncaught PHP Exception Drupal\\Core\\Entity\\EntityStorageException: "SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect decimal value: '' for column 'price__amount' at row 1: INSERT INTO {commerce_product_variation_field_data} (variation_id, type, langcode, uid, product_id, sku, title, price__amount, price__currency_code, status, created, changed, default_langcode) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12); Array\n(\n [:db_insert_placeholder_0] => 15\n [:db_insert_placeholder_1] => default\n [:db_insert_placeholder_2] => en\n [:db_insert_placeholder_3] => 1\n [:db_insert_placeholder_4] => 5\n [:db_insert_placeholder_5] => 45\n [:db_insert_placeholder_6] => Product 1\n [:db_insert_placeholder_7] => \n [:db_insert_placeholder_8] => CNY\n [:db_insert_placeholder_9] => 1\n [:db_insert_placeholder_10] => 1457593015\n [:db_insert_placeholder_11] => 1457593121\n [:db_insert_placeholder_12] => 1\n)\n" at /var/www/html/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php line 757,Comment #6
skyredwang@bojanz on IRC suggested that we need to fix the problem at field level, so it won't happen to any instance of price field.
Patch attached.
Comment #7
mglamanPR for patch https://github.com/drupalcommerce/commerce/pull/356
Comment #9
bojanz commentedWent with:
Cause that means "0 USD" is an actual non-empty value, which I believe is more correct.
Committed, thanks!