Hi,

We've created a webform on our site and want to give anonymous users access to see submissions.
(Anonymous users can submit the form)

When we enable anonymous users to "Access all webform results" the form does not load and generates an error. As soon as we disable this permission it works out fine.

We also looked at the webform issue queue for this but no one else has reported this problem.
Anyone has any ideas?

Thank you
Tejas Mehta

Comments

tejaspmehta’s picture

StatusFileSize
new525 bytes

Hello,

I have figured out that PDOError for anonymous user was coming due to condition provided for anonymous user.

I have created basic patch.

I have tested this for superuser, authenticated user and anonymous user. It worked fine. Please review this.

Thank you
Tejas Mehta

quicksketch’s picture

Status: Active » Fixed
StatusFileSize
new628 bytes

This patch would allow all anonymous users with "view own webform submissions" to see the submissions of all other anonymous users (which is not intended behavior). The submission count should return no results for an anonymous user that has not made any submissions, this would actually make it so that anonymous users all "shared" the same submission count.

In any case, thanks for finding this bug. I've corrected it with the attached patch which returns no results if the user has not yet made any submissions.

quicksketch’s picture

Title: Anonymous user can not access submission inspite of having permission. » PDO error when getting submission count for anonymous users with no submissions

Updating title to reflect the problem being solved.

Status: Fixed » Closed (fixed)

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