Webform provides a "clear" link next to each form instance, but this doesn't seem to have any functionality. Attached patch (diff -Nur) provides functionality for the clear link (delete all submission for the form instance from the webform_submitted_data table); also prompts to confirm deletion before going ahead. Also fixed division by zero error in webform.inc.

CommentFileSizeAuthor
webform_1.patch4.09 KBtownxelliot

Comments

jnt’s picture

Looks good to me, with the normal (albiet hypocritical) comments about doxygen style commenting and conformance to the drupal style guide.

Given that clearing all entries is a fairly significant adventure I would recommend a simple watchdog entry be called in function _webform_clear() to that effect.

I notice you have restricted the functionality to superuser 1, this is probably a good idea. I am working on an individual delete function under the submissions listing.

Upgraded to patch for ullgren to look at it.

ullgren’s picture

Added patch to CVS

ullgren’s picture