Fix crash submitting new ticket with validation errors

This also addresses an issue introduced with e5d6192, where editing custom forms would result in loss of data.