As per the title, when deleting last submission as an anonymous user with "delete own webform submissions" permission it causes a PDO error:

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) ) subquery' at line 1: SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {webform_submissions} webform_submissions WHERE (nid = :db_condition_placeholder_0) AND (is_draft = :db_condition_placeholder_1) AND (uid = :db_condition_placeholder_2) AND (sid IN ()) ) subquery; Array ( [:db_condition_placeholder_0] => 33 [:db_condition_placeholder_1] => 0 [:db_condition_placeholder_2] => 0 ) in webform_get_submission_count() (line 740 of /sites/all/modules/webform/includes/webform.submissions.inc).

We already tried to accommodate for this situation in webform_get_submission_count(), but the current code does not seem to function properly. This patch adjusts the query in a way that should be slightly more performant and less likely to break DBTNG.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Status: Needs review » Fixed

Committed to 7.x branch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.