By changing "$message = array();" to "$message = $form_state['values']" we can..
a) Simplify the code a bit, since we don't need to set every element manually, only those that need manual handling.
b) It allows to add custom fields to the form and use these values inside the hooks, especially hook_privatemsg_message_insert, since that is the only one that exposes the mid while a custom submit function doesn't.
- This is the same behavior as the node system does use, with the exception that $node is an object, see: http://api.drupal.org/api/function/node_submit/6
- It is already possible when you use the api, as all passed in $options are added to $message.
Thoughts?
Comment | File | Size | Author |
---|---|---|---|
#3 | use_form_state.patch | 2.3 KB | NaheemSays |
#2 | use_form_state2.patch | 2.29 KB | Berdir |
use_form_state.patch | 2.23 KB | Berdir | |
Comments
Comment #1
NaheemSays CreditAttribution: NaheemSays commentedThis no longer applies.
Comment #2
BerdirRe-rolled.
Comment #3
NaheemSays CreditAttribution: NaheemSays commentedrerolled to fix the problem and setting to rtbc as it seems to be a good idea and I cannot see any problems with it.
Comment #4
NaheemSays CreditAttribution: NaheemSays commentedBoth patches are identical, so still rtbc.
Comment #5
BerdirFixed and ported to 7.x-1.x-dev too.