#1913084: Introduce a Form interface for building, validating, and submitting forms modified drupal_get_form() to accept either a string form ID or an object implementing FormInterface. drupal_form_submit() needs to do the same.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

Status: Active » Needs review
Issue tags: -Needs tests
FileSize
4.7 KB
2.29 KB

Okay, here we are. That whole docblock change is mostly rewrapping lines.

tim.plunkett’s picture

FileSize
6.06 KB
2.24 KB

chx asked for a helper function to reduce the duplication between drupal_form_submit and drupal_get_form, which is a good idea.

chx’s picture

Status: Needs review » Reviewed & tested by the community

Very simple followup, thanks.

webchick’s picture

Status: Reviewed & tested by the community » Fixed
+++ b/core/includes/form.incundefined
@@ -648,13 +665,14 @@ function form_load_include(&$form_state, $type, $module, $name = NULL) {
+ * @param \Drupal\Core\Form\FormInterface|string $form_arg

@@ -693,7 +711,7 @@ function form_load_include(&$form_state, $type, $module, $name = NULL) {
-function drupal_form_submit($form_id, &$form_state) {
+function drupal_form_submit($form_arg, &$form_state) {

Ooof, that's ugly. :( But apparently this is what we already did for drupal_get_form() which passed catch's watchful eye. Seems like we should make converting all forms to FormInterface a "major" task then, if it isn't already, since shipping this way would not be good...

Since this is just applying the same pattern elsewhere, and since this is a temporary shiv until conversions are complete, committed and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.