Currently I find it impossible to reorder components of a webform.

The user interface works fine, but when I click 'Save' I get the 'When adding a new component, the name field is required.' error. This means it's failing validation for the 'Add' button, which should not be invoked when submitting via Save.

I can't track this one down - the code looks correct and the D7 Form API documentation agrees. But when printing out the form submissions it seems the form is *always* submitted via the Add button and all the extra validation and submission functions are called.

Not sure what's going on, but it's annoying. Solution is to either create the form in the right order the first time, or to comment out the extra validate and submit functions attached to the Add button. In includes/webform.components.inc that's around line 134-5:

  $form['add']['add'] = array(
    '#type' => 'submit',
    '#value' => t('Add'),
    '#weight' => 45,
    // '#validate' => array('webform_components_form_add_validate', 'webform_components_form_validate'),
    // '#submit' => array('webform_components_form_add_submit'),
  );

I'm using Panopoly 1.1, could be a bug in there. If no one else can reproduce this then it's probably my problem :)

Comments

kscheirer’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)
quicksketch’s picture

Hm, odd. Do you know which version of Webform you're using for sure? This isn't occurring in the latest stable releases that I can tell. How big is your form in which you're reordering components?

kscheirer’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

I'm using 7.x-4.x-dev with a short form. At this point I think it's just Panopoly/my site being weird, I was not able to reproduce this on a clean install.