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?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

NaheemSays’s picture

Status: Needs review » Needs work

This no longer applies.

Berdir’s picture

Status: Needs work » Needs review
FileSize
2.29 KB

Re-rolled.

NaheemSays’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
2.3 KB

rerolled to fix the problem and setting to rtbc as it seems to be a good idea and I cannot see any problems with it.

NaheemSays’s picture

Both patches are identical, so still rtbc.

Berdir’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Reviewed & tested by the community » Fixed

Fixed and ported to 7.x-1.x-dev too.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.