I have created a content type with three fields. 1.Integer (field:A) 2.Formula field(Field: B =A+A) 3.Formula field(No Formula)
When I create the content on that content type it is showing a fatal error
PDOException: SQLSTATE[HY000]: PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'field_c_answer' at row 1: INSERT INTO {field_data_field_c} (entity_type, entity_id, revision_id, bundle, delta, language, field_c_answer) 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); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => 4 [:db_insert_placeholder_2] => 4 [:db_insert_placeholder_3] => formula [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => ) in field_sql_storage_field_storage_write() (line 514 of /var/www/poornadrupal/modules/field/modules/field_sql_storage/field_sql_storage.module)
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | Before Patch.png | 107.23 KB | krina.addweb |
| #4 | After Patch.png | 21.54 KB | krina.addweb |
| #2 | fatal_error_when_i_try-2867954-2.patch | 1.71 KB | daiwik.addweb |
| issue.png | 101.96 KB | poornachandran |
Comments
Comment #2
daiwik.addweb commentedIt shows error as you have not entered any formula in 2nd formula field. Below patch will set 0 value if the formula field is blank.
Hope this helps you.
Comment #3
poornachandran commentedThanks @RoshniPatel.addweb ..The patch applied cleanly and the issue is fixed..
Comment #4
krina.addweb commented@RoshniPatel.addweb, Thanks for Providing patch, it really removes the fatal error with Your patch. I checked it using Simplytest.me & attached the Screenshots for the same.
Comment #7
jaykandariCommitted! Thanks everyone for the contribution :)