alphagov/whitehall — pull request #512 by chrismdp (2013-04-29 10:03:56+00:00)
Title: Fix edition display crash when file is missing

1a67a90 refactored a common form pattern to a builder object, but the
semantics of the form changed slightly.

This causes the file upload data attributes to be empty, which removes
the entry entirely from the params. Our uploading controller code
doesn't validate uploaded data if it isn't present in the params at
all, which caused ImageData (and other) records to be created with NULL
ImageData, which crashes the display of those editions in the admin.

Restoring the original semantics fixes the issue. I've also included a
data migration to restore any editions with broken images.