I've done some work writing the functionality to delete individual form submissions (I couldn't find the function which serviced webform/delete requests, so wrote one). I also changed the links in the node/$nid/results/submissions page, from webform/delete/$sid to node/$nid/results/subdelete/$sid. This is so we can reuse the webform_results function to process submission deletions as well. I decided it would be useful to pass both node ID and submission ID to the actual delete function (_webform_submission_delete) to ensure we only delete submissions for the specified node (there shouldn't be a problem as we use the db_next_id function to get submission IDs, but better safe than sorry).

The only area I have problems is understanding how the access controls work, though I've tested the links as an unauthorised user and they aren't accessible. Someone might want to check that access is correctly controlled.

The attached patch contains these pages, plus fixes for the previous broken links issue (19216).

CommentFileSizeAuthor
#3 webform_3.patch2.85 KBtownxelliot
webform_2.patch2.86 KBtownxelliot
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jnt’s picture

Looks good to me. I recommend that the delete pathname be:

node/$nid/<b>results</b>/delete/$sid

which IMHO reads more intuitively than

node/$nid/results/subdelete/$sid

jnt’s picture

Hmmm.. that didn't turn out right. Let me try again.

Looks good to me. However, I recommend that the delete pathname be:

  • node/$nid/results/delete/$sid

    which IMHO reads more intuitively than as in the patch.

  • node/$nid/results/subdelete/$sid
  • townxelliot’s picture

    FileSize
    2.85 KB

    Agreed. Replacement patch attached.

    ullgren’s picture

    Patched in CVS

    ullgren’s picture

    Vako’s picture

    This is a very old post, however I am interested in this patch and am surprised that it is not included in the latest build of Webform (or is it?) I can't see any means of deleting individual submissions in the Submissions/Table of a form.

    I have read the patch directions on this link: http://drupal.org/node/60108
    but would it be possible to get directions specific to applying the patch mentioned in this post? I would very much want to implement this patch since I have a table full of spam and need an option to delete some of the entries. (I implemented CAPTCHA too late...)

    thanks!