Closed (fixed)
Project:
Privatemsg
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
27 May 2009 at 21:42 UTC
Updated:
10 Jun 2009 at 22:00 UTC
The API http://drupal.org/node/369399 says privatemsg_new_thread is as follows:
boolean|array privatemsg_new_thread (string $subject, string $body, array $recipients, [object $author = NULL])
* string $subject: The subject of the new message
* string $body: The body text of the new message
* array $recipients: Array of recipients (user objects)
* object $author: The author (user object, defaults to the current user)
* return: Either true or an array with validation errors
But in the latest code it is as follows:
function privatemsg_new_thread($recipients, $subject, $body = NULL, $options = array()) {
The API doc is a bit self-preserving and says features listed may not yet be implemented, so I didn't want to mess with it yet. Besides, other aspects I'm not dealing with may be wrong too. This was relevant because I am helping Jose with messaging and this issue came up http://drupal.org/node/464002 . The messaging_privatemsg module had been based on the incorrect API which apparently gave users errors. I've posted a potential patch there, so as long as the code remains the same and the API is updated it should be fine...
Comments
Comment #1
berdirYes, it's currently outdated.. have you seen #458366: Fatal error: Unsupported operand types on line 1158 ? That should fix the issue in Messaging.
Comment #2
berdirAlso, you should use http://blog.worldempire.ch/api/function/privatemsg_new_thread/1 instead of 369399, it should be more or less up to date. Generated apidocs are easier to keep up to date with the actual code..