PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'uid' in where clause is ambiguous: SELECT COUNT(*) AS expression FROM {webform_submissions} ws LEFT OUTER JOIN {users} u ON u.uid = ws.uid WHERE (nid = :db_condition_placeholder_0) AND (uid = :db_condition_placeholder_1) ; Array ( [:db_condition_placeholder_0] => 6 [:db_condition_placeholder_1] => 1 ) in PagerDefault->execute() (line 75 of /Applications/MAMP/htdocs/drupal/includes/pager.inc).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ryantboyd’s picture

Sorry, should have added. This error comes up after submission when you return to the webform and have this link: You have already submitted this form. View your previous submissions.

Clicking on "View your previous submissions." Goes to a page that gives:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'uid' in where clause is ambiguous: SELECT COUNT(*) AS expression FROM {webform_submissions} ws LEFT OUTER JOIN {users} u ON u.uid = ws.uid WHERE (nid = :db_condition_placeholder_0) AND (uid = :db_condition_placeholder_1) ; Array ( [:db_condition_placeholder_0] => 6 [:db_condition_placeholder_1] => 1 ) in PagerDefault->execute() (line 75 of /Applications/MAMP/htdocs/drupal/includes/pager.inc)

anavarre’s picture

I confirm this issue.

neclimdul’s picture

Title: Got this error on first use » View your submissions throws database exception.
Component: User interface » Code
Status: Active » Needs review
FileSize
655 bytes
neclimdul’s picture

Priority: Normal » Critical

This does actually fall in the critical or at least major priority.

anavarre’s picture

This patch works fine for me. Thank you !

quicksketch’s picture

Priority: Critical » Major
Status: Needs review » Fixed
FileSize
1.01 KB

Thanks neclimdul. I've adjusted the patch to match our approach in the D6 version of the module, which adjusts the "uid" filter inside of the webform_get_submissions() function. I've committed and pushed the attached patch to the 7.x branch.

mgifford’s picture

Excellent. I just ran into this problem and happy to see it's already been fixed.

48hr turn around time too!

Oh ya, patch applies nicely, but you probably already knew that.

Blooniverse’s picture

Title: View your submissions throws database exception. » PDOException: SQLSTATE[23000] -- when viewing submissions

... the new title indicates more uniquely the substance & subject of this bug.

bradjones1’s picture

@quicksketch - is there a reason the patch in #6 is from a drupal root directory, not the module? My file structure isn't the same so I couldn't apply it directly from the module dir. root. Just curious.

neclimdul’s picture

@bradjones1 I'm sure he just had a install with webforms laying around that was part of a version controlled site. The patch was made against that for simplicity and he forgot to clean it. Its actually the same way i made my patch I just I remembered to clean it. Replace the "sites/all/modules/" with "" and it will apply just fine inside the modules directory.

quicksketch’s picture

Or just install 3.9. The patch in this issue is already in that version.

Status: Fixed » Closed (fixed)

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