I have written a simple component that displays a summary of form values submitted on previous pages. This way one can review their input before finally submitting it.
Only values of fields contained in a fieldgroup on the first level are displayed; the name of the fieldgroup is used as caption.
I think this feature would be interesting not just for me - but I don't know how to procede with adding it to the module. May I just add it via CVS? Any hints are appreciated :-)
By the way: it would be nice if webform allowed to add components by new modules and not just by copying files to the original module.
Comment | File | Size | Author |
---|---|---|---|
#69 | webform-preview_submission-435232-69.patch | 822 bytes | jaroslaw.kaminski |
#61 | webform_preview-435232.patch | 23.71 KB | quicksketch |
#60 | webform_preview-435232.patch | 23.77 KB | quicksketch |
#58 | webform_preview-435232.patch | 12.29 KB | quicksketch |
#58 | webform-preview.png | 83.41 KB | quicksketch |
Comments
Comment #1
quicksketchMarked #330937: Add a priview button as duplicate. Moving to 3.x queue. I didn't even see that there was an upload attached to this issue, though it almost certainly will require updating to work with the 3.x version.
Comment #2
quicksketchThough this issue is a duplicate, I marked the earlier issue #308771: user preview of webform before submission, as duplicate since this one has a patch.
Comment #3
mtkoan CreditAttribution: mtkoan commentedI've add "summary.inc" to webform/components, and it shows up in the admin page as a new component. I added it on the 3rd page of my form, as the only element, but it shows nothing.
What am I missing?
Comment #4
gerritvanaaken CreditAttribution: gerritvanaaken commentedGreat idea with that additional summary component type. Unfortunately I could not get it to work at all - the new component wouldn’t appear in my basic webforms settings, and also wouldn‘t appear in the selection of the component type when adding components to the form itself.
I’ve been using 3.0 beta 4.
Are there any plans to integrate this brilliant patch (if it would work!) to the official distribution of the module? I would appreciate that!
Comment #5
quicksketchI'd like to include this patch in the official version of Webform, but it definitely needs to be updated to the 3.x version before it can be used. I don't think it will make it in before the 3.0 final version, but there's no reason it can't be added shortly afterward.
Comment #6
CraigCamm CreditAttribution: CraigCamm commentedI have summary working in webform 3.x. It appears the component dropdown is now hard coded. The patch I have included modifies webform.module to include the summary.inc file.
Please bare with me, as this is my first contribution to the drupal community and patching in general.
Comment #7
quicksketchThe list is now more flexible than it was before. Webform 3.x introduces hook_webform_component_info(), which allows 3rd-party modules to provided additional components. However since this is a patch to include summary functionality in Webform core, a patch to this list is definitely going to be necessary.
Comment #8
jwineinger CreditAttribution: jwineinger commentedRewrote most of the summary.inc provided above. This works for me on 3.x. Nested fieldsets are supported by text-indent.
Patch adds the summary element to the component list and ADDS the summary.inc file.
Comment #9
quicksketchThis patch might work but it won't be suitable for inclusion in Webform as-is. Rather than manually rebuilding all the display functions of Webform, we should re-use the existing rendering system of submissions that generates the form, e-mails, and submission viewing.
Comment #10
arski CreditAttribution: arski commentedhey there, somehow the patch doesn't include labels of fields in the summary view? that makes it very weird,just to have a list of values.. could you add the title of each field in front or something please, that seems to be commented out now
cheers
PS. I see that using $component['name'] doesn't quite do the trick in there.. hmm.. would be great to have though
Comment #11
dgtlmoon CreditAttribution: dgtlmoon commentedYour patch seems to be acting strange, trying against 3.4 tho...
tho the failed stuff is fairly trivial
Comment #12
dgtlmoon CreditAttribution: dgtlmoon commentedPatch for 3.4 attached
Comment #13
arski CreditAttribution: arski commentedhmm, did you just adjust the old version of the patch to apply to 3.4 correctly or did you actually edit something inside of it too, responding to http://drupal.org/node/435232#comment-3460202 ?
Comment #14
dgtlmoon CreditAttribution: dgtlmoon commentedI applied that patch to 3.4 then cleaned up what didnt apply (because it looked like that was already in the code), then just done a git diff and made a new patch
Comment #15
Dublin Drupaller CreditAttribution: Dublin Drupaller commentedgreat patch and would be a great inclusion in the module. for anyone using 3.2 Craigs patch #6 above worked for me.
dub
Comment #16
arski CreditAttribution: arski commentedunfortunately, it still doesn't solve or reply to the issues outlined in http://drupal.org/node/435232#comment-3460202 which are preventing from getting it committed :(
Comment #17
drupal a11y CreditAttribution: drupal a11y commentedHas anyone an idea how to achieve this with the D7-version?
Please answer here: http://drupal.org/node/974106
Comment #18
gibbser CreditAttribution: gibbser commentedI applied the patch but no summary is displayed.
"The webform component summary is not able to be displayed".
Has anyone an idea?
Comment #19
drupal a11y CreditAttribution: drupal a11y commentedDid not get the summary patch to work with D7!!!! and solved it with a modified template within my theme-folder.
A documentation on how to get the webform-values ist posted here: http://drupal.org/node/980566
Here an example for working with values of Webform 7.x-3.x-Dev (2010-Nov-18).
I copied the "webform-form.tpl.php" into my theme-folder and added the node-id of the specific webform-node: "webform-form-109.tpl.php".
Within the template you get the values like in these examples:
a) from a fieldset named "ottobrunner_konzerte":
$konzertkarten_normal = $_POST['submitted']['ottobrunner_konzerte']['konzertkarten_normal'];
$konzertkarten_ermaessigt = $_POST['submitted']['ottobrunner_konzerte']['konzertkarten_ermaessigt'];
b) from a "normal" field
$preis_ticket_normal = $_POST['submitted']['preis_ticket_normal'];
$preis_ticket_ermaessigt = $_POST['submitted']['preis_ticket_ermaessigt'];
ATTENTION: I am quite not sure if there´s a difference when adding ['value'] at the end.
Any suggestions from the pro´s ???
Comment #20
dgtlmoon CreditAttribution: dgtlmoon commented$konzertkarten_normal = $_POST['submitted']['ottobrunner_konzerte']['konzertkarten_normal'];
Just be sure not to introduce any XSS attacks there
Comment #21
drupal a11y CreditAttribution: drupal a11y commentedSorry - can you explain this for a non programmer like me.
Do you think it´s possible to pass values via get to the "$konzertkarten_normal"-variable?
If yes - how can I solve the problem.
Comment #22
dgtlmoon CreditAttribution: dgtlmoon commentedhttp://api.drupal.org/api/drupal/modules--filter--filter.module/function...
Comment #23
kirdydy CreditAttribution: kirdydy commentedComment #24
kirdydy CreditAttribution: kirdydy commentedI am new to drupal, please bare with me for anything obvious. I applied this webform-3.4-summary.patch but it dint result in options to preview the form. please help with your suggestions.
Comment #25
unclejustin CreditAttribution: unclejustin commentedSubscribing.
Comment #26
deanloh CreditAttribution: deanloh commentedCan anyone confirm if these patches work with 6.x-3.6? Which one should I use?
Comment #27
jeremymcminn CreditAttribution: jeremymcminn commentedCan anyone tell me how to remove fields that are empty from the summary?
This is fairly essential and I am scratching my head.
Thanks.
Comment #28
volito CreditAttribution: volito commentedThis helped me from getting "The webform component summary is not able to be displayed" error:
placing both summary_component.patch and webform-3.4-summary.patch in the webform directory, then patching webform-3.4-summary.patch.
summary.inc will appear in the webform folder - move it to components folder and activate the module.
Unfortunately, selected grid options don't appear in the summary, date values neither.
Is there a way to get them to show up?
thx
Comment #29
arlanda CreditAttribution: arlanda commentedsubscribing
Comment #30
xqi CreditAttribution: xqi commentedsubscribing
Comment #31
doublejosh CreditAttribution: doublejosh commentedSubscribing.
Comment #32
doublejosh CreditAttribution: doublejosh commentedSubscribing.
Comment #33
dgtlmoon CreditAttribution: dgtlmoon commentedWhat is remaining to make this patch ready for commit?
- Select grid
- Dates ?
Comment #34
jeremymcminn CreditAttribution: jeremymcminn commented@dgtlmoon So empty fields do not show?
Comment #35
CNek CreditAttribution: CNek commentedSubscribing.
Comment #36
jeremymcminn CreditAttribution: jeremymcminn commentedHi Mate
Any idea how to hide fields that haven't been filled in?
The summary works perfect otherwise!!
Thanks
Comment #37
gaia CreditAttribution: gaia commentedHi everybody,
could someone please upload the patched version of the webform folder. I know how to patch, but in this case I'm trying to apply the patch on the 6.x-3.4 version for hours - without success.
Due to deadline pressure any help would be appreciated.
thanks in advance
Comment #38
reza213 CreditAttribution: reza213 commentedHi everybody,
Does anybody know, how to show the labels of the fields in the summary?
Is it possible to show multiple values from select list in the summary? And of course it would be great to hide fields that haven't been filled in.
Thanks
Comment #39
reza213 CreditAttribution: reza213 commentedHi,
Please, does anybody has an idea, how to show the lables of the field and show the multiple values from the select list in the summary.
Many thanks
Comment #40
easp CreditAttribution: easp commentedAfter upgrading to Webform 3.9 the summary patch in #12 broke on me.
In the summary.inc file around line 119 I replaced:
with:
The old code was getting the component number instead of the form_key. Works fine for me now.
Comment #41
M. P. CreditAttribution: M. P. commentedHi,
I am trying to get the summary-patch to work with drupal 7.
I am hanging on one last thing which I didnt get yet, maybe you could help me out:
As I understand this, in the webform function a subfunction named _set_summary is called.
In the set_summary function $form_element['#value'] has all the summarized data which is needed BUT
how could I access this data in the _webform_render_summary function? On the Summary-Site there is nothing displayed.
_set_summary
Best Regards
Markus
Comment #42
Pure CreditAttribution: Pure commentedHi Markus,
i use this code and it works
Comment #43
quicksketchHi guys, thanks for the updates. Once you get it working if you can reroll the patch and upload it that will help move this project forward.
Comment #44
dealancer CreditAttribution: dealancer commentedHey guys.
I've found patches awesome. I have ported it to D7 and totally reimplemented the way how rendering works, now it using code like this, a bit different, but more cool:
Don't rush to commit this to the Webform module, cause it is already committed to the Webform Bonus Pack 7.x-3.x module, now I am back-porting this to D6. Issue is here http://drupal.org/node/1242914.
Comment #45
dealancer CreditAttribution: dealancer commentedNow new Summary component available both for 6.x-3.x and 7.x-3.x versions of Webform Bonus module.
P.S.
Summary looks similar ways as in submission view.
Comment #46
rampy.s CreditAttribution: rampy.s commentedHi,
I have built a form using the form API and not using webform. Can this preview/summary function be re-used for a form built with Form API? Any idea if its already available?
Comment #47
dealancer CreditAttribution: dealancer commentedUnfortunately no,
but you can configure nodes to show preview button before submission.
Comment #48
Liam MorlandWill this feature be added to Webform core or remain only in Webform Bonus?
Comment #49
quicksketchI would like to add it to Webform core. The Webform Bonus implementation works but I'd like to have it cleaned up a bit before being included in Webform directly.
Comment #50
DrupalDan CreditAttribution: DrupalDan commented@quicksketch, is there any time frame for the inclusion?
Comment #51
dealancer CreditAttribution: dealancer commentedGreat. Thx. I am going to sync 6.x to 7.x to make sure there are all new features in 7.x.
Comment #52
woop_light CreditAttribution: woop_light commented+1
Is this something that is in the works? It would be a huge help.
Comment #53
quicksketchI would like to add something like this officially to the project, but we haven't had a patch version of this feature since #12. I'm still not entirely sure which approach is best: a summary component (like Webform Bonus provides) or a review/confirmation page as an option. If people have insight as to how they would like it to work, please provide a narrative of you would expect to add and configure such an option from the perspective of a site editor or administrator.
Comment #54
woop_light CreditAttribution: woop_light commentedIt seems like it would work well to have a tickbox option "Present user with a review page before submission" on the advanced settings page (perhaps under "Status of this form").
The review page, which would be a page inserted at the end of the form, would then be a simple rendering of the previously entered values -- looking much (or exactly) like when the user chooses to view his/her own submission. This last page, which is only editable by going back to parts of the form using the Previous and Next buttons, would house the "Submit" button.
Do others think that might be a good way to go about it? I'm afraid that when digging through the code I've had trouble wrapping my head around bits of the webform architecture, so my suggestion may not take into account certain programming considerations.
You're the man Nate.
- Walter
PS Sorry for the delayed response
Comment #55
woop_light CreditAttribution: woop_light commentedquicksketch, any way to sponsor this feature?
Comment #56
quicksketchHi @woop_light! I sent you an e-mail last week about sponsoring after you contacted me. I'll re-send it.
Comment #57
quicksketchI've been working on implementing this feature. Per #53/54, this will probably be implemented as a form setting rather than as a component. This reduces conflicts with Form Builder, though it may be a slightly less flexible system (not allowing other components on the same page).
Comment #58
quicksketchHere's the in-progress patch on this front, adding new settings to the Webform configuration for the preview option. This isn't fully working yet, as the main preview itself doesn't actually work yet. But the options are all there, save properly, and the form adds a page for the preview itself. This isn't ready for testing quite yet, just a status-update on this issue.
Here's how it looks in the UI. There are more options than I originally anticipated, considering we need to provide labels for the preview page and buttons. I'm a little worried this might be too overwhelming, but all settings are actually optional. Thoughts?
Comment #59
woop_light CreditAttribution: woop_light commented@quicksketch -- Looks great -- the controls make perfect sense to me. Can't wait to see it in action!
Comment #60
quicksketchThis version is ready for testing. It requires a new update hook to add the new database columns, so be sure to run update.php after patching. You should also make a database backup before upgrading in case you need to roll back the change.
Overall, I really like this functionality. Combined with the new progress bar, this really makes Webform feel like a complete package for complicated multi-page forms.
Comment #61
quicksketchMinor documentation tweaks.
Comment #62
quicksketchCommitted to the 7.x-4.x branch. Moving this to be ported for the 8.x-4.x branch.
Comment #63
pawel.traczynski CreditAttribution: pawel.traczynski commented@quicksketch - can please push latest 7.x-4.x-dev branch to d.o. so this this can be simply downloaded within the whole package?
Comment #64
fenstratCommitted to 8.x-4.x in 336e2a4. Thanks!
@pawel.traczynski this is already part of 7.x-4.x-dev as it was committed in d0a1fc5.
Comment #65
jaroslaw.kaminski CreditAttribution: jaroslaw.kaminski commented@quicksketch Something is wrong.
When I used version 7.4-dev I got error like in here: https://drupal.org/node/2119193
So I downloaded 7.4-beta1 and used your latest patch file I got same error. But when I used this patch #58 node and fields are added properly.
Comment #66
jaroslaw.kaminski CreditAttribution: jaroslaw.kaminski commentedAnd after I added node got error: Notice: Array to string conversion in drupal_write_record() (line 7129 of /includes/common.inc).
Comment #67
jaroslaw.kaminski CreditAttribution: jaroslaw.kaminski commentedWhy preview page is not in theme system and I can't theme it? :(
Why confirmation message is in warning alert? :(
all this functionality is written not in drupal way :(
I think next version of preview page have to be writen with tokens. Like https://drupal.org/project/webform2pdf There you can customize pdf file and all fields are tokens and I can create whatever I want and just paste my token. Simple and nice to use.
Comment #68
pawel.traczynski CreditAttribution: pawel.traczynski commentedYes, i agree with Jarek. The way this summary functionality is done is totally not in-accordance with Drupal way of doing things.
And why hardcode warning message? What user will like it?? :D
Cheers Jarek ;)
Comment #69
jaroslaw.kaminski CreditAttribution: jaroslaw.kaminski commentedI found that $preview_message don't use submission tokens because you used $submission. I changed it to: $preview_submission.
Comment #70
quicksketchThe preview page is explicitly part of the webform-form.tpl.php file, already broken-out and printed separately specifically so it's easy to change.
Is that not adequate?
Because the default message is exactly that: a warning that the submission isn't completed yet and you need to click the submit button. If you would prefer it wasn't a warning, then you can change the webform-form.tpl.php file (as shown in the code above).
The preview page does support tokens, but like you pointed out, this is more an accident than a failure in the architectural approach.
Comment #71
jaroslaw.kaminski CreditAttribution: jaroslaw.kaminski commentedOk. Now I understand that ;-) But first I was little confused. UI of creating a multistep form is complicated. For example title of first page you can change on form settings, but second page is title of page break, and in confirm page on fields summary you can see only a title of 2 title and higher. At first it was hard to understand some things. Now I founded webform-tpl.php and removed warning and after fixed some little bug I was able to make a confirm page as I wanted ;-)
But please look at: https://drupal.org/node/2119193 because there is critical bug on actual version. You can't save webform and grahamC created a patch fot this.
Comment #72
quicksketchThanks @jaroslaw.kaminski for the helpful patch. I've pushed these changes into the 4.x branch and it'll be in the new release tomorrow.
Comment #74
fenstratNeeds porting to 8.x-4.x.
Comment #76
fenstratCommitted 0e1e18d to 8.x-4.x.
Comment #78
hmartens CreditAttribution: hmartens commentedThe preview page is awesome! Thanks quicksketch!
Is there a way to style the preview page like a template file I can edit?
Thank you