I have a content type with a location field. The location field is set to "unlimited" number of items.

By default the create node page contains two blank location fields, with an option to add more, and no delete option for either.

Saving the node without completing the location fields results in a MySQL error:

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'field__firmsearch_locations_lid' at row 1: INSERT INTO {field_data_field__firmsearch_locations} (entity_type, entity_id, revision_id, bundle, delta, language, field__firmsearch_locations_lid) 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] => 6460 [:db_insert_placeholder_2] => 6542 [:db_insert_placeholder_3] => accredited_firm [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => ) in field_sql_storage_field_storage_write()

The "field__firmsearch_locations_lid" field is trying to be saved with a blank value.

When the location field is set to any other number of values - e.g. 3 - the node can be saved correctly and there is no SQL error.

Comments

Leo Pitt’s picture

Leo Pitt’s picture

Status: Active » Closed (duplicate)

Closing as duplicate - will add my comment to the pre-existing issue.