I am prepopulating a field and also using hook_form_alter to disable that field so the user can't change from the pre-populated value. However elsewhere in the form there is a second multiple-value field that has an "Add Another item" button. If you use the "Add Another Item" button then save the form, the pre-populated value in the first field is lost. I believe the issue is that the "Add Another Item" causes the form to be rebuilt and at this time the $REQUEST does not contain the prepopulate ['edit'] value. In debugging I found that the issue doesn't arise with entity reference prepopulate module and that it stashes data into the $form_state. So I tried patching prepopulate module to do the same and fixed the issue.

CommentFileSizeAuthor
prepopulate.patch762 bytesjzornig
Support from Acquia helps fund testing for Drupal Acquia logo