- Issue created by @jekuaitk
- Status changed to Needs work
about 1 year ago 4:05pm 25 June 2024 - 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
Thanks for the patch.
When creating a new hook, it needs to be documented in
webform.api.php
.Please use an issue fork and merge request.
- 🇺🇸United States jrockowitz Brooklyn, NY
I agree the WebformComputedBase:postSave method, makes it very difficult to alter a webform submission computed value.
What is also challenging is entity hooks are triggered before element and handler hooks. Reordering entity, element, and handler hook execution is risky.
We could try moving WebformComputedBase:postSave logic to WebformComputedBase:preSave. This could work for the webform_encrypt.module which is using WebformEncryptSubmissionStorage.::doPostSave to encrypt the submission values
- 🇺🇸United States jrockowitz Brooklyn, NY
Using WebformComputedBase:preSave won't work because people might be relying on sid and serial values.
The webform_encrypt.module might be only the only usecase for new hook.
Instead, maybe the webform_encrypt.module should override WebformComputed::preSave using hook_webform_element_info_alter() and implement the required logic.