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)

Comments

Poornachandran created an issue. See original summary.

daiwik.addweb’s picture

Status: Active » Needs review
StatusFileSize
new1.71 KB

It 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.

poornachandran’s picture

Thanks @RoshniPatel.addweb ..The patch applied cleanly and the issue is fixed..

krina.addweb’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new21.54 KB
new107.23 KB

@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.

jaykandari’s picture

Status: Reviewed & tested by the community » Fixed

Committed! Thanks everyone for the contribution :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.