When a fieldset is deleted, its children need to have their "parent" field updated. Otherwise, the former children are displayed incorrectly on the input form.

CommentFileSizeAuthor
#3 webform_remove_amp.patch1016 bytesquicksketch
fieldset_del.patch990 bytesgribnif

Comments

quicksketch’s picture

Status: Needs review » Fixed

Thanks, nice patch! Committed to 4.7 and 5.

shouchen’s picture

Status: Fixed » Active

For me, this patch causes the following error. (PHP version is 4.3.11)

Parse error: parse error, unexpected '&', expecting T_VARIABLE or '$' in /path_to_drupal_installation/sites/all/modules/webform/webform.module on line 379

The line in question:

foreach ($node->webformcomponents as $cid => &$component) {

If I remove the & in &$component, the parse error is fixed.

-Steve

quicksketch’s picture

StatusFileSize
new1016 bytes

Hmm weird I didn't notice that. Try using the following patch on top of the current CVS to correct this issue. The & can't just be removed, as then the fields are properly re-parented, the entire point of the patch.

quicksketch’s picture

Status: Active » Fixed

I've applied my suggested patch above.

Anonymous’s picture

Status: Fixed » Closed (fixed)