For some reason, as an anonymous user, when I visit a form which has both entity reference with pre-populate, and also a file upload, when I use the file upload field (which ajax submits), on the next submission of the form the entity reference field which is pre-populated is now empty.
I've had a look and it seems that the form is manipulated on ajax submit for the file upload, and because the URL doesn't have the GET vars which prepopulate looks at, clears the field. On the next submission/load of the form, this empties the field.
I'm not too sure how to go about this, but I've found that by making the function
entityreference_prepopulate_get_values_from_url aware of this, we could grab the info needed for prepopulate from
$_SERVER['HTTP_REFERER'], though I'm not sure this would be the best solution.
Any help would be welcome, thanks! :)