Closed (won't fix)
Project:
Privatemsg
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Mar 2009 at 09:00 UTC
Updated:
30 Oct 2009 at 15:06 UTC
Jump to comment: Most recent file
Comments
Comment #1
berdirhttp://blog.worldempire.ch/api/function/privatemsg_new_thread/1
$recipients is an array of user objects, for example:
Can you please paste the code that sent a message to anonymous? That should not be possible, the validate function should check if all recipients are valid user objects.
Comment #2
berdirUpdated the above link with a short example.
Also, make sure to have a look at #375999: #288183 followup: Developer friendlify privatemsg_new_thread API. because that patch will change the order of the parameters.
Comment #3
nathaniel commentedExcellent that works perfectly! Thank you for the quick response and explanation...
What I am trying to do is integrate Privatemsg so that when a user requests to join a group (og module) the group owner will receive a private message alerting them of the request.
I am using the latest dev release for Privatemsg (2009-Mar-06). At first I just dropped $admins in for the recipients and it was sending messages to "Anonymous".
$recipients = array(user_load($node->uid)); works
$admins sends to "Anonymous"
Here is the code from the og module beginning around line 980:
Comment #4
berdir1) $admins is an array of uids, you can use the user objects with the following code:
2) It seems that og is executing a hook, you could use that to send messages instead of changing the code of og. Untested example code:
I am changing the thread to a bug report, it seems that the validate function does not correctly validate the recipients array.
Comment #5
berdirAttached is a patch which should detect if you pass anything else than a user object with an uid property.
Edit: This needs to be ro-rolled after #375999: #288183 followup: Developer friendlify privatemsg_new_thread API. (or the other way round), because the patch uses the old error format.
Comment #6
berdirComment #7
litwol commented#375999: #288183 followup: Developer friendlify privatemsg_new_thread API. is in, should this be rerolled?
Comment #8
berdirDone.
Comment #9
berdirDrupal core does not test/validate proper params so probably we shouldn't either. Setting this to won't fix.