I want to delete a webform submission from a custom module that I've written. I'm using webform_submission_delete(123, 76)
. The error I receive is:
Notice: Trying to get property of non-object in webform_submission_delete() (line 141 of /Applications/MAMP/htdocs/mercury/sites/all/modules/webform/includes/webform.submissions.inc). Warning: Invalid argument supplied for foreach() in webform_submission_delete() (line 141 of /Applications/MAMP/htdocs/mercury/sites/all/modules/webform/includes/webform.submissions.inc). Notice: Trying to get property of non-object in webform_submission_delete() (line 153 of /Applications/MAMP/htdocs/mercury/sites/all/modules/webform/includes/webform.submissions.inc). Notice: Trying to get property of non-object in webform_submission_delete() (line 157 of /Applications/MAMP/htdocs/mercury/sites/all/modules/webform/includes/webform.submissions.inc).
I'm a bit new to module development. Am I missing something?