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.
Current status
In webform3 webform_get_submissions()
tries to get all webform_submissions and webform_submission_data in one database query (repeating the webform_submissions metadata for each component). This has been refactored for webform4 and is now done in two queries: one for the submissions and one for the submission data. As a side-effect the webform_submissions data is now more easily extensible via hook_schema_alter()
.
Motivation
- The main motivation is that I've recently taken over maintainership of webform_submission_uuid (adds a uuid column to webform_submissions). With this backport it would be possible to use the same code for webform3 and webform4.
- As noted in the commit messages this improves performance of submission loading.
Changes
These are the changes (as close as possible) that I would like to backport:
- http://cgit.drupalcode.org/webform/commit/?id=c126f7d (excluding the pagerQuery).
- http://cgit.drupalcode.org/webform/commit/?id=b120eae
Results
- Improved forward compatibility
- Improved performance
- No API or behaviour changes
Comment | File | Size | Author |
---|---|---|---|
#6 | 2600316-webform_get_submission-backport-6.patch | 2.43 KB | torotil |
|
Comments
Comment #2
torotil CreditAttribution: torotil at more onion commentedHere is the proposed patch.
Comment #4
torotil CreditAttribution: torotil at more onion commentedNice to have tests!
Comment #5
torotil CreditAttribution: torotil at more onion commentedThis patch restores the index-sort optimization for
webform_submitted_data
. I made the mistake to use the filter on thewebform_submissions
-query instead.Comment #6
torotil CreditAttribution: torotil at more onion commentedThis patch makes it also work when we are loading a non-existing submission.
Comment #7
DanChadwick CreditAttribution: DanChadwick commented@torotil - you're the webform 7.x-3.x branch maintainer. Want to commit this? Otherwise we should close is as won't fix.
Comment #8
torotil CreditAttribution: torotil at more onion commentedYes, I'm happy to commit this in the next days. I have used this in production on several sites this past months. Thanks for reminding me.
Comment #10
torotil CreditAttribution: torotil at more onion commentedCommitted to 7.x-3.x.