When converting settings forms, the resulting submitForm() will save any values in form elements to the config object. But that includes the form build values, e.g. form_build_id and form_token, which can be easily cleaned up to avoid being saved.

The attached patch cleans these up and then saves values according to what was in the form state rather than the form. I could believe that it might still be better to use what form elements exist as the basis of the loop, but certainly the form state should be cleaned up first and then only values that still exist in the cleaned-up form state should be set in the config object.

CommentFileSizeAuthor
dmu-config-clean-values.patch670 bytesjames.williams
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

james.williams’s picture