ConfigFormBase::buildForm()
defines a submit button but does not attach a default submit handler to submit button which causes a problem with configuration forms not being saved if other modules attach their own submit handlers on top of the default ones.
Real world example: If a site has content_translation
module enabled, then Account settings configuration form will not be saved because AccountSettingsForm::buildForm()
method does not define a submit handler and content_translation_language_configuration_element_process()
function, that wants to perform certain content translation actions, is attaching its own submit handler which becomes the only submit handler for the form.
ConfigFormBase::buildForm()
should provide a default submit handler for the form so that submitForm()
method is always called for configuration forms regardless of other submit handler additions made by other modules, unless specifically removed from the submit handlers list.
Comment | File | Size | Author |
---|---|---|---|
#1 | configformbase-missing-submit-handler-2355053-1.diff | 597 bytes | maijs |
Comments
Comment #1
maijs CreditAttribution: maijs commentedA patch against latest commit
3fb2ec3
is attached.Comment #3
larowlanComment #4
maijs CreditAttribution: maijs commentedComment #5
BerdirSee my comment in the other issue, I think this is by design. This is the default behavior of all forms, if a submit callbacks are added on specific buttons, the global ones are no longer called.
This could be just as confusing the other way round, with this, global submit callbacks would no longer work.