Fix issue where custom field names are not correctly identified
Causes form data to be misinterpreted
Example problem: editing a declaration fails validation checks because the form data is not interpreted correctly.
This fixes the problem of setting an end date on an old declaration and creating a new one. However, if just an end date is set (without a new declaration) the value is updated but crashes - not sure what the intended flow is there.