Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Leo Pitt CreditAttribution: Leo Pitt commentedDuplicate of http://drupal.org/node/1961630 !
Comment #2
Leo Pitt CreditAttribution: Leo Pitt commentedClosing as duplicate - will add my comment to the pre-existing issue.