hi there,

just tested the API function privatemsg_reply() in order to use it in my own module.
Seems like the thread_id isn't appended to the $message array, before $message is passed to _privatemsg_send(). That's why a NEW message (having the same subject as the thread-starting message) is sent, instead of appending a reply.

The UI-reply is done by hook_form_altering the original new_message-form, so the bug never appears when not explicitly using the api-function. Therefore it's maybe only a matter for developers :-)

A fix should be quite easy by adding the missing thread_id to the message-array.

CommentFileSizeAuthor
#2 api_reply_patch.patch762 bytessandfurz
api_reply_patch.patch760 bytessandfurz

Comments

berdir’s picture

Status: Active » Needs work

I noticed that too.

+  $message['thread_id']=$thread_id;

There should be spaced before and after the =.

sandfurz’s picture

StatusFileSize
new762 bytes
berdir’s picture

Status: Needs work » Reviewed & tested by the community

Looks good now.

litwol’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

naheemsays’s picture

Status: Fixed » Reviewed & tested by the community

This has not been committed yet.

naheemsays’s picture

Status: Reviewed & tested by the community » Fixed
litwol’s picture

This was rather weird. using my old checkout from d.o (this one is many months old but still *clean*) i was able to commit this patch but it didnt actually arrive in the repository O_o... i even deleted privatemsg.module and ran update to restore it which still showed the patched line.

i then did a whole fresh checkout which showed me privatems.module without the patched line .... ah so weird. anyway i commited it, verified it. and closing this issue :).

http://drupal.org/project/cvs/3279

Status: Fixed » Closed (fixed)

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