1. Create a new webform with an 'email' field.
2. Add a pagebreak.
3. Add a 'textarea'.
4. Save webform.
5. Go to the form and fill it out. Submit.

Results from webform_submitted_data:

| 1 | 2 | 1 | 0 | morbus@disobey.com |
| 1 | 2 | 2 | 0 | Pagebreak |
| 1 | 2 | 3 | 0 | Yep, this is a textarea. |

Expected result: since pagebreak is not a user-submitted field, it shouldn't be saved into webform_submitted_data.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Morbus Iff’s picture

Status: Active » Needs review
FileSize
1.54 KB

Here's a patch for this. It specifically checks for a component of type 'pagebreak' in the various submission CRUDs. Hardcoding such a component type like this, especially for pagebreak, has precedence - it's scattered throughout webform.module as well. In short, pagebreak is a display option, not a data storage component, and shouldn't be saved as part of a submission. I've tested submitting a new webform, editing this saved webform submission, and editing the saved webform submission with entirely new values. The pagebreak component is not saved into webform_submitted_data.

Morbus Iff’s picture

Assigned: Unassigned » Morbus Iff
quicksketch’s picture

I couldn't reproduce this problem when editing submissions, but it definitely showed up when submitting new ones. Perhaps there's a browser difference that could cause that inconsistency.

When reviewing though, I didn't experience a difference in where the components were stored in the $node object. In you comments you noted that for updates there isn't a $node->webform['components'], instead only $node->components. This shouldn't be the case and if components is still existing in the root level of the node object then we have a problem somewhere else.

Could you try out the attached patch and see if it corrects the problem?

Morbus Iff’s picture

I'll have to re-test. My original attempt at fixing this problem was pretty much the same as yours - with the webform index on both the insert and update. However, after the updates continued to save the pagebreak item, I did a bunch of dvr()'s and noticed that the structure was different.

Morbus Iff’s picture

Status: Needs review » Reviewed & tested by the community

I was unable to reproduce the saving of pagebreak, so the patch in #3 is RTBC.

quicksketch’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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