As promised, this is a patch against 6--2 for the signup_webform module in Joachim's recent contribution to add webform 6.x-3 support.

David

Comments

fax8’s picture

subscribing. looking for some time for testing this one..

macdee’s picture

I forgot to mention that this patch also expands the number of supported webform field types and also recognizes fields within fieldsets, but ONLY if you are using Webform 6.x-3 and above**.

**There has been no change made to the limited field type behavior for anyone using versions of Webform prior to 6.x-3, nor is there any intention to do so. That part of the code was only included to maintain the status quo for legacy users.

netv’s picture

Wow very cool, and EXACTLY what I'm looking for right now.
But... don't actually know how to use it and what to do exactly?
Could you please write a real short tutorial, step-by-step what to do?
Where can I find the signup_webform module??
I have signup and webform installed, and attached a node-reference field to the signup-content where I can select a webform, right?
What file(s) do I need to patch? Do I need something else? How do I apply the functionality? Do I need something in template.php?

macdee’s picture

@Gevatter Tod You should read http://drupal.org/node/29568 to see the long history behind this.

The short answer is that you need to follow the "View all releases" link from the Signup main project page and apply this patch against the signup 6.x-2.x-dev branch. Once you've tested the functionality please report back here.

David

netv’s picture

Thanx David,
After I've applied the patch I get the following Error message when trying to call the node for signup:

Fatal error: Call to undefined function drupal_get_installed_schema_version() in /var/www/virtual/XXXXX.de/htdocs/XXXXX/sites/all/modules/signup/modules/signup_webform/signup_webform.module on line 68

macdee’s picture

It's a standard Drupal function that's been around forever (see http://api.drupal.org/api/function/drupal_get_installed_schema_version) so I doubt it's mia... did you flush your caches and run update.php after applying the patch? I'm thinking that your site thinks it's still using the old version of the module.

If that fails, try unloading and reloading the module.

netv’s picture

Hm... Yes, I tried flushing the cache before and called up update.php.
Right now I even deinstalled everything from the signup module and installed it again.
Everytime I try to configure the signup settings for a node it's the same error-message above...
by the way, I did't have the error before applying the patch ...but then fileuploads did't work.

fax8’s picture

are you sure that you are running Drupal 6.x?

netv’s picture

well... yeah... I AM pretty shure, thanx.
6.19, and newest webform module, too.

macdee’s picture

@ Gevatter Tod Thanks, I was able to reproduce the error using a fresh install.

Until I figure out why this is happening and can roll a new patch, just manually change line 68 to "return TRUE;" instead of what is currently written there and you should be able to continue with testing.

David

netv’s picture

Ok, many thanx! It works.
Here's a little bug:
If I go to "Edit webform components" from the signup, then I can select which field to add... if I submit it jumps right back to the signup-configuration page instead of adding a field and going on to the configuration of that field.

Filefields don't work either, do they? Simply nothing happens there, when I add a local file and submit the form. Form is submitted but no file is stored or sent.

If I combine several forms in one signup, the data is stored seperatly in every webform-results-table? So I can't see all Submissions of a combined signup and export them right?

If I use one form in multiple different signup nodes, all results run together in the same webform results?

macdee’s picture

StatusFileSize
new41.57 KB

@ Gevatter Tod:

#5 I fixed the problem with the error message you were getting... it seems that you have to make sure the installation API is already available before calling drupal_get_installed_schema_version(). Learn something new everyday!

#11a I've also addressed your concern with the "add field" but you'll now have to navigate back to the signup-configuration page manually after editing webform components.

#11b I see what you say about file uploads, I'll have to look deeper into that when I have time.

#11c Since everything to do with webforms is stored by webforms itself you get your results the webform way. If you want to combine multiple webform results I suggest using views and the csv exporter in the views bonus pack.

I've attached a new patch (use the patch in #16, not this one) against 6.x-2.x-dev that includes fixes for #5 and #11a

netv’s picture

Thanx macdee, good job anyway!
I also had the idea with views and the bonus pack, but the problem with using the same webform for different nodes still applies then... I can't figure out which entry is for which node... maybe with a "referer"-field...

According to the module itself: Would't it work fine if a copy of the chosen webform is generated (changing the name in "[webformname] - [node-title of signup-node]" evertime a webform is assigned to a node-signup?

Next Idea: Instead of the "Informations" for each signup in the signups overview then there could be a link to the webform result instead.

Just some ideas, and pretty much influenced about my current projekt issue ;-)
But anyway, this would be an awesome solution for signups.

macdee’s picture

@ Gevatter Tod #13:
I don't think that making copies of webforms programmatically would be useful. Not only would it really upset the webform module, but even making local copies kind of defeats the purpose of using webform's native storage.

Keep in mind that all the information you need is available in signup's db tables so you should be able to create a views relationship that takes those factors into account and display whatever you want to see.

macdee’s picture

StatusFileSize
new41.49 KB

Ignore this... I was tired and used the wrong file.

macdee’s picture

StatusFileSize
new41.53 KB

Revised patch with some minor bug fixes. Use this instead of the one in #12

macdee’s picture

StatusFileSize
new43.18 KB

More tweaks. All standard webform 3 field types work as expected except for file, which unfortunately gets flushed during the submission process.

joachim’s picture

Status: Needs review » Needs work
+++ signup/modules/signup_webform/README.txt	2010-10-22 11:15:49.000000000 -0700
@@ -1,4 +1,4 @@
-$Id: README.txt,v 1.1.2.1 2010/10/18 21:42:11 joachim Exp $
+$Id$

Please don't include Id changes in patches; CVS takes care of this.

+++ signup/modules/signup_webform/signup_webform.info	2010-10-22 11:15:50.000000000 -0700
@@ -1,14 +1,7 @@
-; Information added by drupal.org packaging script on 2010-10-19
-version = "6.x-2.x-dev"
-core = "6.x"
-project = "signup"
-datestamp = "1287447546"

Ditto. You should be working from a CVS checkout and these lines should be absent from it anyway.

+++ signup/modules/signup_webform/signup_webform.install	2010-10-22 13:35:25.000000000 -0700
@@ -1,7 +1,8 @@
- * @file signup_webform.install
+ * @file
+ * Install file for signup_webform

Don't make unrelated changes please.

+++ signup/modules/signup_webform/signup_webform.install	2010-10-22 13:35:25.000000000 -0700
@@ -38,7 +39,7 @@ function signup_webform_schema() {
-  
+

... or alter whitespace ;)

+++ signup/modules/signup_webform/signup_webform.module	2010-10-26 01:26:15.000000000 -0700
@@ -40,33 +39,65 @@
+function signup_webform_webform3() {
+  // Check if this is Webform 6.3x
+  // Make sure the installation API is available before running drupal_get_installed_schema_version()
+  include_once './includes/install.inc';
+  return drupal_get_installed_schema_version('webform') > 6300 ? TRUE : FALSE;
+}

I don't see where this is called from or how it's used, but I don't see the point of it. Webform 3 is now the only supported version -- all we need to do is say in the documentation and the project page that you need Webform 3. End of story. At a push, we can stick a hook_requirements(), if we're really feeling nice.

This patch has now exceeded its kitten allowance. Could you tidy up and I'll try to find time to review it again?

Powered by Dreditor.

PS. Also, WTF?

+  return drupal_get_installed_schema_version('webform') > 6300 ? TRUE : FALSE;

You're testing for truth and THEN on the back of that returning TRUE or FALSE? You already have that!!!

macdee’s picture

Status: Needs work » Needs review
StatusFileSize
new37.38 KB

@joachim: Stripped out all the older webform stuff so this is strictly webform 3 (which also eliminates the need for the WTF line... yeah, yeah, I guess it was a little redundant :))

Rolled against -6--2 as per request.

edit** Sigh... looks like some of the preamble leaked into this one. Please use the patch in #20 instead. (I wish I could alter my own file attachments when editing so I didn't have to keep adding comments).

macdee’s picture

StatusFileSize
new34.55 KB

Please use this instead of the patch in #19.

macdee’s picture

StatusFileSize
new29.57 KB

Minor revision to reduce size.

macdee’s picture

StatusFileSize
new29.96 KB

with an implementation of hook_signup_update for multiple webforms in the same signup.

joachim’s picture

Status: Needs review » Needs work
+++ signup/modules/signup_webform/signup_webform.module	2010-11-01 23:22:43.000000000 -0700
@@ -100,7 +101,7 @@ function signup_webform_signup_pane_info
- *   If this is an existing signup, the fully loaded signup object. If this is a 
+ *   If this is an existing signup, the fully loaded signup object. If this is a

You're still making a load of spurious changes to whitespace.

+++ signup/modules/signup_webform/signup_webform.module	2010-11-01 23:22:43.000000000 -0700
@@ -111,41 +112,31 @@ function signup_webform_signup_pane_info
-  $webform_nid = substr($pane_id, 8);
+  $webform_nid = drupal_substr($pane_id, 8);

Given that pane ids are machine names, I doubt we need unicode support in dealing with them.

+++ signup/modules/signup_webform/signup_webform.module	2010-11-01 23:22:43.000000000 -0700
@@ -111,41 +112,31 @@ function signup_webform_signup_pane_info
+  // Add the signup sid to the form.
+  $form['details']['pane_id'] = array(
+    '#type' => 'hidden',
+    '#value' => $pane_id,

Comment and code do not agree.

+++ signup/modules/signup_webform/signup_webform.module	2010-11-01 23:22:43.000000000 -0700
@@ -155,69 +146,226 @@ function signup_webform_form(&$signup_fo
+      // Set a cookie including the server's submission time.
+      // The cookie expires in the length of the interval plus a day to compensate for different timezones.
+      if (variable_get('webform_use_cookies', 0)) {

What's this for? Is it cribbed from similar behaviour in webform?

+++ signup/modules/signup_webform/signup_webform.module	2010-11-01 23:22:43.000000000 -0700
@@ -155,69 +146,226 @@ function signup_webform_form(&$signup_fo
+    // Check if this form is sending an email.
+    if (!$is_draft && !$webform_data['details']['finished']) {
+      $submitted = webform_get_submission($webform_nid, $sid, TRUE);
+
+      // Create a themed message for mailing.

Do we really have to do all this? Does webform not have a function we can call? If not, and it does everything in the submit handler, then maybe consider submitting a patch to it?

+++ signup/modules/signup_webform/signup_webform.module	2010-11-01 23:22:43.000000000 -0700
@@ -275,14 +436,14 @@ function signup_webform_signup_form_data
@@ -292,36 +453,6 @@ function signup_webform_signup_form_data

@@ -292,36 +453,6 @@ function signup_webform_signup_form_data
     // as an additional field for the ['signup_log']['form_data'] field.
     $submission_sid = $form_data[$pane_id]['sid'];
     $submission = webform_get_submission($webform_nid, $submission_sid);
-    
-    // Check there is an actual submission: if no webform fields are compulsory,
-    // a user can sign up and not create a corresponding webform submission.

What are you doing for the form_data hook?

+++ signup/modules/signup_webform/signup_webform.module	2010-11-01 23:22:43.000000000 -0700
@@ -332,66 +463,27 @@ function signup_webform_signup_form_data
- * Implementation of hook_nodeapi().
- *
- * When a whole signup node is deleted, delete data related to it.

This too.

+++ signup/modules/signup_webform/signup_webform.module	2010-11-01 23:22:43.000000000 -0700
@@ -426,10 +518,53 @@ function signup_webform_form_node_delete
+    drupal_set_title(t('Unable to delete Submission #' . $submission_sid, array('%title' => $node->title)));

Call to t() is missing the token.

+++ signup/modules/signup_webform/signup_webform.module	2010-11-01 23:22:43.000000000 -0700
@@ -426,10 +518,53 @@ function signup_webform_form_node_delete
+ * Form validation function.

Move this so it's immediately after the form builder.

+++ signup/modules/signup_webform/signup_webform.module	2010-11-01 23:22:43.000000000 -0700
@@ -439,16 +574,21 @@ function signup_webform_get_signup_submi
+  * Errors are suppressed here because webform_get_submission() throws a SQL warning for previously signed up users
+  * of an existing signup if a new webform has just been added that didn't exist when they initially registered.
+  * Once the signup is re-saved thus including the new webform, the warning will no longer appear.

Are those more than 80 cols wide?

Also, nitpick, but it's 'an SQL', not 'a SQL'. ;)

Also, by 'a new webform added', do you mean created as a node, or added to the signup system? If the latter, then we should be able to act on its addition and fix our data. Suppressing errors doesn't seem like a good thing to me.

Powered by Dreditor.

macdee’s picture

@joachim: Sorry, these were not meant as "spurious" changes to whitespace. I merely addressed whitespace and formatting issues in the original that Coder was complaining about. Ditto with the string functions. I tried to revert as much as I could find back to what you previously had just to cheer you up.

You're right, the cookie and email parts are most likely superfluous and I may be able to offload those items back to webform. I just haven't had the need to re-visit that part because I'm not using that functionality on my test site. I will take a deeper look when I can.

The form_data_display_alter function: This is probably no longer doing anything useful... it's just what was left of the original routine you wrote after I removed webform 2 specific references and changed the includes. I haven't removed it completely yet because I was unsure of any negative impact without checking further. A corresponding webform submission is always created, even if all the fields are left blank. Components are themed by webform.

The hook_nodeapi: I chose not to delete associated webform submissions when deleting the signup because there's the strong possibility that somebody might want to use the collected data from within webform for other purposes and it seemed presumptuous to unilaterally remove that data. If the time comes that the user wishes to deep six them then that can be accomplished via webform's own interface.

Other points taken.

As for the nitpick, I guess it's all in how you pronounce it. I pronounce it as 'sequel' not as individual letters.

I will see what I can fix, but it may take awhile until I have time.

joachim’s picture

> I merely addressed whitespace and formatting issues in the original that Coder was complaining about. Ditto with the string functions. I tried to revert as much as I could find back to what you previously had just to cheer you up.

Please read up about how best to make patches -- in particular, search for webchick's blog post about patches and kittens. In brief: a patch should address ONE thing only.

> As for the nitpick, I guess it's all in how you pronounce it. I pronounce it as 'sequel' not as individual letters.

Indeed, but Wikipedia seems to say the standard pronunciation is as initials ;)

joshuarr’s picture

sub

peterm95018’s picture

Any movement on this issue? I could use some webform v3 compatibility with signup 6.x-2.x-dev.

joachim’s picture

Patch needs work -- it's up to someone with the time to work on it.

schackattack’s picture

subscribing

MathFreak.be’s picture

Hi

I installed signup and signup webform from the following location: https://github.com/joachim-n/signup which contains a singup_webform.module file form march 3, 2010.

I am a bit confused on which patch if any I should be using. Right now it isn't working, when I try to go to a page that has a signup with a webform, I get this message:

Fatal error: Call to undefined function webform_load_components() in C:\xampp\htdocs\drupal_6_2\sites\all\modules\joachim-n-signup-226fc7e\modules\signup_webform\signup_webform.module on line 124

Help appreciated

robotjox’s picture

subscribe

meichr’s picture

Hi,
I'm interested in the signup_webform integration module including any patch necessary for adapting it to the most up-to-date version of webform (and signup) under Drupal 6. Maybe, it could also be useful for the signup rules integration module I'm working on (still a sandbox project).

Is there a reason that the signup_webform module is not available on drupal.org as a project? Now, that drupal.org has moved from cvs to git, I mean. Are there plans for an official module?
Thanks for any info,
Christian.

macdee’s picture

@meichr:
Christian,
The signup_webform module that you see here relies on specific features only found in the 6.x-2x-dev version of signup and last I heard 6.x-2x-dev is not in sync with the current dev version of signup and may never be, thus it won't work as a separate standalone module/project.

I did do some further work that improves upon the parsing of the webform elements over the latest patch above but I also discovered that file uploads within a webform and multi-page webforms do not seem to be compatible with the way the forms get rendered in 6.x-2x-dev so I put aside creating any more patches until I could come up with a solution that would also include those capabilities. Then 6.x-2x-dev seemed to go off the rails so I was waiting for the dust to settle to see if it was worth proceeding down this path.

I have strongly considered a complete rewrite so that it doesn't depend on 6.x-2 and would be a complete standalone but haven't pursued it.
David

ajzz’s picture

This module has great potential. The current reason why we are not using SignUp for events is because more than three fields of information are typically requested from people attending events. A signup_webforms module will be great by allowing the flexibility of webforms with the convenience of reminders etc.

+1 vote for a project

MasterChief’s picture

Interesting idea, i am agree with macdee, a separate module will be better and compatible with 6.x-1-x.dev of signup will be great :)

scottrigby’s picture

Status: Needs work » Needs review
StatusFileSize
new28.97 KB

Just to be practical with respect to branching (1.x not 2.x), but also to go ahead & test even before commit, I'm re-rolling this patch against another patch here #1148552: Sync 6.x-2.x with 1.x/master. Reasons explained in #1 of that issue.

I made the following changes to this patch:
* replaced pane_id drupal_substr() instances with substr()
* changed sid comment to pane_id
* removed cookie stuff
* fixed missing token in t()
* moved signup_webform_form_validate() just below signup_webform_form()
* wrapped comments in signup_webform_get_signup_submission at 80 columns with //
* followed wikipedia about SQL pronunciation just for fun (a to an)
* I left the whitespace cleanup, because - why not.

@joachim I don't have answers to some of the other questions you raised about macdee's last patch. However, unless there's a solution, this is better to get working insist on perfection at this point. Maybe we'll even get this all in the 6.x-1.x version of Signup. That's be pretty sweet wouldn't it?

scottrigby’s picture

StatusFileSize
new28.94 KB

Typo in above patch. Also, fix the t() token to read as it should.

ezra-g’s picture

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

marking this as won't fix per #1148552: Sync 6.x-2.x with 1.x/master -It would be great to see this functionality made available as a separate project, and I'd be happy to improve the Signup API if necessary to help make this possible.