This module provides a confirmation screen for the Webform module. After large demand for this kind of module in Japan and not being able to find one I decided to create one mysql. It uses some elements of the form api but the actual review form is put together using xml parsing. I plan to have this as a full form api solution in the near future.

Comments

mermentau’s picture

You probably forgot your sandbox link. http://drupal.org/sandbox/mackstar/1075540

mackstar’s picture

Thank you!

mackstar’s picture

Sorry typo I didn't get much sleep last night,not mysql -> myself

joachim’s picture

Status: Active » Needs work

> 3 * An implementation of preprocess_node to rewite the web form
4 * in order to have a confirmation page. This is done by using
5 * php's xml_parser functions

What...?

12 function webform_confirm_preprocess_node(&$vars) {
13 global $webform_confirm_flag;
14 if($_SERVER['REQUEST_METHOD'] == 'POST' && $webform_confirm_flag) {
15 $p = xml_parser_create($p);
16 xml_parser_set_option($p, XML_OPTION_CASE_FOLDING, 0);
17 xml_parser_set_option($p, XML_OPTION_SKIP_WHITE, 1);

This looks pretty bad. Let me get this straight -- you're hacking the node output on *every single node output* just in case it's a webform, to hack about with the form...? You really think this is a good idea?

> I plan to have this as a full form api solution in the near future.

Yes, that would be the correct Drupal way to do it... I suggest you reopen this when you've got that done :)

And also...

> 292 if($is_webform) {

Code style!

mackstar’s picture

Thanks for your input,

I am not actually hacking every single node output at all because of the $webform_confirm_flag I have raised only after I have a clear submission.

Because of the order of the form_alter -> validation -> submission seems to mean that you cant use form alter after submission.

I have spent a lot of time with the form api before and I am quite familiar with it. How can I implement form_alter to reproduce the form after a validation or submission? Is it even possible? Or do I have to make another form?

Point taken on code style 292...

Cheers

joachim’s picture

Two approaches spring to mind:

A. Convert the form to being a multi-step form. This may or may not be possible at the HFA level, but worth a shot as it would be the cleaner way. The 2nd step of the form is then the confirmation page.

B. Use HFA to replace the submission handler with your own. In that, store the entire $form_state somewhere safe and redirect to your confirmation form page. In your confirmation page's submit handler, use drupal_form_execute to submit the stored $form_state -- I did all this just recently with http://drupal.org/project/form_email_confirmation.

Or of course there's...

Z. Submit this all as a patch for webform ;)

clemens.tolboom’s picture

Status: Needs work » Closed (won't fix)

I agree with Joachim option Z to make this a patch for webform. It would improve webform.

As the module is not moving forward I put it on a won't fix. Feel free to reopen.

The http://drupal.org/project/webform module provides a very similar feature to this module.
One of the 7 principles of the Drupal project is collaboration. Would you consider merging your project into that one and collaborating with its authors?

Otherwise, it would be great if you could document what makes this module different so that people can make a good decision about which one to use.

Powered by Dreditor (triage sandbox) and Triage transitions

avpaderno’s picture

Component: new project application » module
Issue summary: View changes