The code makes an incorrect assumption about how webforms saves these in webform_submissions table, those attributes are not (and should never) be changed from the original submitter data.

So I have a patch that will add these attributes to the web_revisions table (for the current revision) and keep them there instead for each revision. Once I get it cleaned up will attach it here.

Best regards,
Rich

Comments

Anonymous’s picture

StatusFileSize
new7.56 KB

Here's my patch to 1.0 beta2. Please read it before applying. It's changing the revisions table, so you'll have to reinstall webform_revisions module.

richardp’s picture

Thanks for your work on this!

As soon as I get some time, I will check this out, and try to incorporate it into the next release.

Richard

smurfix’s picture

Version: 7.x-1.0-beta2 » 6.x-1.2
StatusFileSize
new3.18 KB

Attached please find a patch for version 6, which has the same problem.

Always_learning’s picture

Hello all,

I am very new to drupal - I'm using MAMP as my local server and drupal 6.x (with webform_revisions - 6.x-1.2. I haven't learnt enough of how to apply a .diff as a patch.

a) could someone kindly post a .patch file for D6.x?

b) could someone direct me to some documentation where I can learn how to work with a .diff file patch?

Thank you!

pinolo’s picture

Status: Active » Needs work

I have reviewed the 6.x patch and it looks quite good. One problem is that existing revisions get a 0 timestamp so they all show up as modified in 1970. I wonder what is the best solution: writing an update script for existing data or looking up data from webform_submissions when values are 0?

pinolo’s picture

Status: Needs work » Needs review
StatusFileSize
new7.41 KB

The patch I'm uploading contains the previous "diff" by smurfix, modified and with several additions/integrations.

  • Based on smurfix's work, handles correctly the changing of submitted date, user, remote address through submission updates; if no valid details are found in webform_revisions, data from webform_submissions is used
  • Given that UID 0 is actually a user (anonymous), I changed the table schema for webform_revisions, in order for that field to support NULL values
  • Fixed the logic used when calling webform_revisions_copy_existing_to_revisions(), that messed up labels when saving new revisions or reverting to old ones.
  • Avoids the "duplicated entry" error quoted in #1382002: Shows Submitted date instead of Revision Date which create duplicate entry (not able to track revision date), due to the fact that Webform (probably only ver. 3.x) saved in webform_submitted_data values form the revisions field appended by this module to the webform
  • Also integrates small l10n fixes I already posted on #1418452: Strings in webform revision's fieldset are not translatable

I hope someone can review this "cross-patch". Also, having run out of free time, looking for someone integrating the .install dile with an update script that updates the webform_revisions table structure.