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:

Results

  • Improved forward compatibility
  • Improved performance
  • No API or behaviour changes
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

torotil created an issue. See original summary.

torotil’s picture

Status: Active » Needs review
FileSize
2.63 KB

Here is the proposed patch.

Status: Needs review » Needs work

The last submitted patch, 2: 2600316-webform_get_submission-backport-1.patch, failed testing.

torotil’s picture

Status: Needs work » Needs review
FileSize
2.63 KB

Nice to have tests!

torotil’s picture

FileSize
2.36 KB

This patch restores the index-sort optimization for webform_submitted_data. I made the mistake to use the filter on the webform_submissions-query instead.

torotil’s picture

This patch makes it also work when we are loading a non-existing submission.

DanChadwick’s picture

@torotil - you're the webform 7.x-3.x branch maintainer. Want to commit this? Otherwise we should close is as won't fix.

torotil’s picture

Yes, 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.

  • torotil committed 5acd758 on 7.x-3.x
    Issue #2600316 by torotil: Partially backport webform_get_submissions()...
torotil’s picture

Status: Needs review » Fixed

Committed to 7.x-3.x.

Status: Fixed » Closed (fixed)

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