Tested this in a variety of ways, with multiple users and different field collections with different types of fields in them. In every case, if we have one or more field collections set up in admin/config/people/accounts/fields, and we bump up the version number on the disclaimer, two things happen:

  1. The user is asked to accept the disclaimer twice. Checking accept and submitting the form brings the user back to the disclaimer form. Checking accept and submitting a second time brings the user to the site as usual.
  2. The field collection instances attached to that user are lost. The field collection ID disappears from the user object, and the data for that field collection ID is removed from the database.

Comments

vali hutchison’s picture

This seems quite worrying - any progress on this.

I have checked it though on the sandbox of my site which does use multiple user fields and I don't get this error - all the user data is retained after changing the version number. Nor does the user get asked twice to accept the terms.

pezia’s picture

Issue summary: View changes
StatusFileSize
new460 bytes

The same happened to me: our users have an image field which got corrupted after accepteing the new terms.
I've changed one line, and it happend to work for me.

It now loads the whole user before saving.

Scott Robertson’s picture

Status: Active » Needs review

Patch makes sense to make, as the $user variable may not necessarily contain the user's field data if user_load() hasn't been previously called on it, which is what can cause data loss. Setting to Needs Review for tests to run.

Scott Robertson’s picture

Priority: Normal » Major

Status: Needs review » Needs work

The last submitted patch, 2: site_disclaimer_user_save_corruption_fix.patch, failed testing.

Scott Robertson’s picture

Status: Needs work » Needs review
StatusFileSize
new532 bytes

Rolling a new patch.

Scott Robertson’s picture

Status: Needs review » Reviewed & tested by the community

  • Scott Robertson committed 18a4cd3 on 7.x-1.x
    Issue #2112617 by Scott Robertson, pezia: Field Collection data is lost...
Scott Robertson’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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