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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dmitriy.trt’s picture

Oooops, wrong file.

Dmitriy.trt’s picture

FileSize
660 bytes

Here is a correct one

quicksketch’s picture

This 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.

Dmitriy.trt’s picture

Third-party modules can test for 'values' existence, maybe this should be documented. This patch is just simplifying work with submitted values.

quicksketch’s picture

Status: Needs review » Closed (won't fix)

It'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.