Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow-up to #2863425: Anonymous view own submission
Problem/Motivation
Anonymous submissions can be track via $_SESSION. This will user limits to be tracked and saved anonymous submissions converted to authenticated submission after a user logs in.
Proposed resolution
Add support for 'view own submission' permission and anonymous submissions.
Remaining tasks
- Never convert confidential anonymous submissions to authenticated submissions
- Add 'view own permission' to webform.permissions.yml.
- Remove comment about 'view own permission''
- Add 'Anonymous' role to Webform Access tab view/update/delete own.
- Add $check_session parameter to allow WebformSubmission query methods. Default to FALSE. This will help to clearing indicate when $_SESSION is meant to be used.
- Add WebformSubmissionStorage::setQueryConditions()
- Update \Drupal\webform\Entity\Webform::checkAccessRules
- Update WebformSubmissionStorage::setAnonymousSubmission
- Refactor account based queries to $_SESSION
- WebformSubmissionStorage::getTerminusSubmission
- WebformSubmissionStorage::getSiblingSubmission
- WebformSubmissionStorage::getMaxSubmissionId
- WebformSubmissionStorage::getTotal
- Update 'session' context to check submission 'view own' access.
- Add WebformTestBase::updateAnonymousUser
- Check \Drupal\webform\WebformSubmissionForm::checkUserLimit
Tests
- Anonymous user limits based $_SESSION.
- Anonymous user view previous.
New Premissions
- 'view own webform submission':
- 'edit any webform submission':
- 'edit own webform submission':
- 'delete any webform submission':
- 'delete own webform submission':
API changes
Session tracking will be added to the WebformSubmissionManager.
Comment | File | Size | Author |
---|---|---|---|
#11 | add_support_for_view-2863809-10.patch | 60.85 KB | jrockowitz |
| |||
#8 | add_support_for_view-2863809-8.patch | 60.21 KB | jrockowitz |
Comments
Comment #3
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #8
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #11
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #15
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented