Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | webform_pagebreak_data.patch | 1.41 KB | quicksketch |
#1 | p_239336_pagebreak.patch | 1.54 KB | Morbus Iff |
Comments
Comment #1
Morbus IffHere'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.
Comment #2
Morbus IffComment #3
quicksketchI 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?
Comment #4
Morbus IffI'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.
Comment #5
Morbus IffI was unable to reproduce the saving of pagebreak, so the patch in #3 is RTBC.
Comment #6
quicksketchCommitted.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.