Save and Save component submit buttons should be wrapped in action type.

Added this workaround for now:

function mytheme_form_alter(&$form, &$form_state, $form_id) {
  switch ($form_id) {
    case 'webform_components_form':
    case 'webform_component_edit_form':
    case 'webform_email_edit_form':
      // BUG: Form submit buttons consistently grouped in actions array, see #2028497
      // Workaround for webform module <3.9.
      if (isset($form['submit'])) {
        $form['actions'] = array('#type' => 'actions');
        $form['actions']['submit'] = $form['submit'];
        unset($form['submit']);
      }
      break;
}
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hass’s picture

Title: Make forms follow core standard forms » Make action forms follow core standard forms
hass’s picture

Looks like there is a developer rule for this:

Form submit buttons consistently grouped in actions array

hass’s picture

Issue summary: View changes

a

hass’s picture

Issue summary: View changes

a

hass’s picture

Issue summary: View changes

a

hass’s picture

Title: Make action forms follow core standard forms » Form submit buttons not grouped in actions array
hass’s picture

Version: 7.x-3.9 » 7.x-3.x-dev
Status: Active » Needs review
FileSize
1.44 KB

Patch attached. I'm on 3.19

hass’s picture

This bug seems to be fixed in 4.x.

hass’s picture

Issue summary: View changes

a

quicksketch’s picture

Status: Needs review » Fixed

Yeah I only made the change to 4.x because I had some minor concerns about users that had altered or themed these forms. Overall it's a minor concern though, I think going ahead and making this change in 3.x would be a good thing. Pushed up to the 7.x-3.x branch.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

a