If you add a field collection to a user entity and set the widget type to hidden, saving a new user results in the following error:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'field_listings_revision_id' cannot be null: INSERT INTO {field_data_field_listings} (entity_type, entity_id, revision_id, bundle, delta, language, field_listings_value, field_listings_revision_id) 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); Array ( [:db_insert_placeholder_0] => user [:db_insert_placeholder_1] => 11215 [:db_insert_placeholder_2] => 11215 [:db_insert_placeholder_3] => user [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => [:db_insert_placeholder_7] => ) in field_sql_storage_field_storage_write() (line 448 of /modules/field/modules/field_sql_storage/field_sql_storage.module).


kscheirer’s picture

Status: Active » Postponed (maintainer needs more info)

I was not able to reproduce this bug, can you provide more detail on how to recreate it? Please verify that you're using 7.x-1.0-beta4+14-dev.

I added a field collection to the user account settings, and regardless of the widget setting (hidden or embedded), I had no problem creating a new user. I was able to leave the FC fields empty and create a user, but that bug is already documented here: #1289062: Required fields in collection not validated when empty.

gboggs’s picture

I've figured out what caused the problem and how to fix it.

In my hidden field collection field... I had not checked "Display on user registration form." Once I checked that box on the field and saved the field, I could now create users with hidden field collections.

jmuzz’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (works as designed)

See #2.