Closed (fixed)
Project:
Privatemsg
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Feb 2009 at 00:04 UTC
Updated:
31 Jul 2009 at 00:10 UTC
Jump to comment: Most recent file
Perhaps _privatemsg_send should give more feedback than always returning TRUE.
currently we use _privatemsg_send() inside conditional statements to make sure message was sent successfuly, however it always returns true rendering those checks somewhat useless.
In the future we should make _privatemsg_send perform various checks to make sure message was sent successfully and what not. maybe conditional statements around db_query... right now i am not sure, just brainstorming :)
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | privatemsg.return_value4.patch | 6.38 KB | berdir |
| #9 | privatemsg.return_value3.patch | 5.74 KB | litwol |
| #6 | privatemsg.return_value2.patch | 4.43 KB | berdir |
| #1 | privatemsg.return_value.patch | 4.78 KB | berdir |
Comments
Comment #1
berdirAnd I already thought this would stay open forever ;)
Attached patch returns $message which is passed through in the key message in privatemsg_new_thread() and privatemsg_reply().
Also fixes/improves some related apidocs and fixes a bug (success is not correctly set to FALSE if $form is TRUE).
Comment #2
frankcarey commentedAh, another just-in-time patch :) Will test shortly
Comment #3
naheemsays commentedJust tested and this works.
Comment #4
frankcarey commentedoh, yeah... forgot... tested and works :) Patch required for my migrate => private message module.
Comment #5
litwol commentedAfter recent commits this failed to apply.
Comment #6
berdirRe-roll.
Comment #7
naheemsays commentedReady to go in.
Comment #8
frankcarey commentedwhen this goes in , I have a migrate integration module that will import privatemsg. Hopefully a release soon so folks can use it.
http://drupal.org/project/migrate_extras
Comment #9
litwol commentedNotice the change in pm_send and _privatemsg_send.
most API that return status as TRUE actually return status of message validation BEFORE actually writing messages to DB. this patch makes _privatemsg_send return FALSE if db error occured. Now the rest of the API need to be updated to reflect this change and use actual send status of success or failure.
Comment #10
berdirUpdated privatemsg_new_thread() and privatemsg_reply() and fixed a type (A an.. ) in the error message. Tests still pass, surprisingly ;)
Your turn! ;)
Comment #11
litwol commentedCommitted patch from #9 along with some comments to better explain the new behavior of the API.