Closed (outdated)
Project:
Webform
Version:
7.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
5 Oct 2019 at 14:39 UTC
Updated:
23 Sep 2025 at 14:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
torotil commentedComment #3
torotil commentedComment #4
torotil commentedIn addition to the API changes the patch migrates webform’s own implementation of
hook_webform_results_download_submission_information_data()tohook_webform_results_download_submission_information_data_row().Comment #5
torotil commentedComment #6
torotil commentedComment #7
r-mo commentedApplying this patch causes all standard submission information to be removed from the result set.
A little debugging reveals the information is returned correctly by webform_results_download_submission_information_data_row but is then deleted by the per token hook as there is now no return value for the webform_sid, webform_time etc tokens.
I suspect the if (isset($data[$token])) was intended to be if !isset but this would prevent modules altering any results from data_row on a per token basis.
Comment #8
torotil commentedThanks for taking a look at my patch!
True, I’ve created a new patch that should fix both issues. It invokes the old alter-hook for all token values regardless of how the data is provided.
Comment #9
torotil commentedI would love to see this API improvement go into one of the next releases. I think all issues mentioned in #7 are solved in #8. On top I think this improves exporter performance quite a bit.
Comment #10
liam morlandThe API needs to be backward-compatible. webform_webform_results_download_submission_information_data() is not a private function, so it needs to continue to work. The new parameters to hook_webform_results_download_submission_information_info() need default values.
Comment #11
torotil commentedAh, this is indeed relevant if other modules invoke
hook_webform_results_download_information_info(). I have changed the hook implementation to have only optional parameters and a comment stating why they are here.Comment #12
torotil commentedIs there still a chance of getting this in at this point?
Comment #13
torotil commentedHere is a re-roll against the current 7.x-4.x branch.
Comment #14
liam morlandDrupal 7 is no longer supported. If this applies to a supported version, please re-open.