I'm working on a module that stores additional data that is collected with a webform. The only thing is, I'd like it to be able to store the reference to the submission id, so that it can be loaded in again later.
As it stands now, the webform module captures the $sid for new submissions but doesn't store it with the $form_values, where other modules could make use of it.
It appears that there are additional checks which test the presence of $form_values['details']['sid'] to determine whether or not it is a new submission, so I figured it would be less disruptive to simply create a new entry for it.
I've attached a patch which should accomplish this.
Comment | File | Size | Author |
---|---|---|---|
#1 | webform_save_sid.patch | 1.78 KB | quicksketch |
save_sid.patch | 563 bytes | mandclu | |
Comments
Comment #1
quicksketchRather than putting the sid in a new place, I'd prefer to update the sid stored in the details array with the new value. Then set an additional property 'is_new' to say whether this is an insert or an update. This mirrors the approach taken by node insert/update and keeps the sid in a single location. What do you think?
Comment #2
marcingy CreditAttribution: marcingy commentedPatch in #1 tested. Works correctly. RTBC. Correct version to 5.x-2.0-beta2
Comment #3
quicksketch@surge_martin Want to give it a second review or should I go ahead and commit? Just wanting to make sure it'll work in your use-case. No offense marcingy. :D
Comment #4
Morbus Iffquicksketch: we're all one big happy family - marcingy, surge_martin, and I are working on the same project :)
Comment #5
quicksketchPorted to 6.x and committed to both versions.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.