Tracking changes to submissions

We discussed at some length in Chapter 3, Working with Submissions that previous versions of submitted data are lost for good when we edit any submission, that is, submitted data updates occur on a replacement basis.

The Webform Revisions module makes it possible for us to track changes made to submissions after the fact. As we edit submissions, historic versions of the data are stored separately from the standard Webform tables. Any historic version can be reverted so that it is again the current version of data in so far as Webform is concerned.

Getting ready

Let's navigate to the Webform Revisions homepage at http://drupal.org/project/webform_revisions and download the latest 7.x version. The compressed folder needs to be extracted in sites/all/modules so that we have sites/all/modules/webform_revisions.

Now we navigate to our site's Modules page to enable the module by checking the box next to its name and clicking on Save configuration.

How to do it...

Let us navigate to our speaker registration form by navigating to Content in the menu toolbar and clicking on Speaker Registration.

  1. Navigate to the Results tab and click on the EDIT action for the first submission in the list.
    How to do it...
  2. Let's change the speaker's First name by adding the text v1 at the end of it (in our preceding example, the First name field will now contain the text John v1) and click on the Next Page > button.
  3. We find that a new fieldset entitled WEBFORM REVISION INFORMATION has appeared immediately above the Click here to submit your registration button.
    How to do it...
  4. We enter the text Added v1 to the Log message textarea and click on the Click here to submit your registration button to save our changes.
  5. Let's return to the Results tab and select Edit on the same submission we selected earlier.
  6. We notice that we have a new tab named REVISIONS which we click to see a history of this submission's data.
    How to do it...
  7. We click on the submission date to view a previous version of a submission. The text we enter into the Log message textarea when we make changes to a submission displays under the date that each change took place.
  8. To restore a previous version of data to current, we merely click upon revert or to completely remove a previous version we click on delete.

How it works...

TheWebform Revisions module stores historic versions of the submitted data. Effectively Webform Revisions stores the before data was changed version of a submission, whereas Webform stores the after data was changed version of an edited submission.

Data journaling (that is, before and after pictures of what data looked like when changes occur) can be very useful in situations where changes to submitted data may have financial or even legal implications. In the financial and legal contexts, we may find that the process is described as creating an audit trail. Audit trails are invaluable when a need exists for enquiries regarding data to be investigated, that is, to determine the origin or motivation that caused the submitted data to be altered.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset