Problem/Motivation
webform_service_parse_submission($webform, $submission) parses a submission from an external format into what webforms expect. The problem with it is that it forces many submission properties and it ignores everything from the external submission except the data array. Despite it allowing some changes via an alter hook, this only allows changes on the modified submission object, without access to the initial submission data.
I have found that I need to know the data from the original submission in my alter hook in order to meaningfully update the submission_obj.
Proposed resolution
I propose to add the original submission object to the hook alter so it can be used for the modules implementing the alter.
From drupal_alter('webform_service_submission', $submission_obj); to drupal_alter('webform_service_submission', $submission_obj, $submission);.
Remaining tasks
1. Do the patch.
2. Review by the community.
User interface changes
None.
API changes
None. The changes are backwards compatible with implementations of a single hook alter argument.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | webform_service-extend-hook-alter-arguments-2886214-1.patch | 468 bytes | kurkuma |
Comments
Comment #2
kurkuma commentedComment #4
tyler.frankenstein commentedLooks good, thank you!