Closed (fixed)
Project:
Webform
Version:
7.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Aug 2015 at 23:23 UTC
Updated:
25 Jan 2016 at 13:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
gregglesComment #3
gregglesComment #4
danchadwick commentedLooking at the sql implementation, do we have to deal with table prefixes?
http://api.drush.org/api/drush/commands%21sql%21sync.sql.inc/function/sq...
This goes in the drush file with the drush commands?
Shall we delete submissions too, which contain a record of when and who submitted the webform? If we don't, then we will have empty submission (which is fine if that's what is desired)
Comment #5
gregglesI suggest deleting submissions as well. I was looking for big tables.
I'm not sure there is a good way to deal with prefixes in these hooks. I think people with prefixes are used to the feature not working for them.
Comment #6
danchadwick commentedThere's a bit of a problem with doing this in bulk. Every component gets a chance to delete something, and then every module gets a chance at deleting. See webform_submission_delete().
Also see the related issue with clearing large numbers of submissions.
And if webform_results_clear uses the batch api, then we could loop through all webform nodes. This could be written to not consume unlimited memory, but it could take a verrrry long time.
Can drush commands use the batch api?
Comment #7
danchadwick commentedGreg -- Can you clarify what is desired here?
I am in the process of creating a drush command to delete a node's submissions, which is slightly related to this issue.
Comment #8
gregglesI think 2 is ideal, but I'm not sure that drupal is bootstrapped sufficiently to achieve it. It's worth trying it out.
Comment #9
danchadwick commentedI thought that Drupal was fully bootstrapped for drush commands. I just wrote a drush command that deletes the submissions for one node. This command would do the same but for all webform nodes.
We can see if it is useful. Could be hours of execution for really bit databases.
Comment #10
gregglesFor a random drush command, it is, sure. For sql-sanitize it might not be. Can you try that in sql-sanitize?
Comment #11
danchadwick commentedAck. I don't think a proper job is possible. Consider:
Regardless of the bootstrap question, the hook is invoked before the confirmation for the purpose of building SQL commands. I think the best we can do is truncate the relevant databases.
Here's a patch. Someone else can test this, please.
Comment #12
danchadwick commentedNo testing? :( Well, let's commit it since I'm pretty confident that the SQL is correct it it follows Greg's template.
Committed to 7.x-4.x.
Comment #14
danchadwick commentedNeeds up-port to D8.
Comment #15
fenstratCommitted and pushed to 8.x-4.x.