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 API is not very comfortable to use, because in submission hooks (insert, update, presave) you only have access to cid-indexed array of values. But sometimes we need to have values indexed by machine-readable-name. For example, when third-party module is using API to process submissions of multiple forms, but processing is done for one field with the same machine name.
Patch is very simple. It was made from latest CVS code.
Comment | File | Size | Author |
---|---|---|---|
#2 | webform-3.x-api-values.diff | 660 bytes | Dmitriy.trt |
ckeditor-6.x-1.1-fix-popup-detection.diff | 2.36 KB | Dmitriy.trt | |
Comments
Comment #1
Dmitriy.trt CreditAttribution: Dmitriy.trt commentedOooops, wrong file.
Comment #2
Dmitriy.trt CreditAttribution: Dmitriy.trt commentedHere is a correct one
Comment #3
quicksketchThis won't work because you don't always have the $form_state to work with. Say you've loaded a submission from the database, changed it, then saved it again, you'll never have a $form_state because a form was never loaded to modify the submission. The exclusion of the use of $form_state is entirely intentional, since we can't assume that submissions are modified only through a user manually submitting a form.
Comment #4
Dmitriy.trt CreditAttribution: Dmitriy.trt commentedThird-party modules can test for 'values' existence, maybe this should be documented. This patch is just simplifying work with submitted values.
Comment #5
quicksketchIt's not simplifying work if you only have it to work with some of the time. It's intentional that we don't use $form_state['values'] here.