Closed (won't fix)
Project:
Privatemsg
Version:
5.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
21 Jan 2008 at 13:23 UTC
Updated:
1 Jul 2009 at 19:03 UTC
Jump to comment: Most recent file
Comments
Comment #1
Zen commentedAuthors aren't supposed to set patches to RTBC. Somebody needs to review them first.
Comment #2
nodestroy commentedi have extended the module with an workflow_ng action to send privatemsg´s
Comment #3
fagoit looks good, however I found some issues:
* you forgot to place //$Id$ in your file
* use the @file doxygen for documenting the whole file
* includes: use the whole path for including. Without some people will have troubles.
* function pm_workflow_ng_action_send_privatemsg has bad coding style. add a space before {, furthermore it looks like there are tabs in it.
* when you invoke the event, you previously load the users. this is not good, as they will be loaded whether they are needed or not. Change them to be loaded by a handler, so they are loaded only when used.
* so why do you invent $privatemsginfo ? Why not just pass $message to workflow-ng and add token support for that?
Then why do we add this as a separate module?
Couldn't we implement privatemsg_privatemsg() too? Then we could add this is as an include file, that is automatically included when workflow-ng is activated. -> More user friendly.
We could also add a new include file for the default configuration and let it workflow-ng include through hook_module_info (only when necessary!). Lookup workflow_ng_module_info() as example. This would probably make more sense than the action include, but it would only work with w-ng 2.x, but I don't think that matters really.
Comment #4
nodestroy commentedthanks for your review.
* added $Id$
* improved documentation with @file comments
* whole path for including
* cleaned coding style issues
* handler for arguments (i´m not really sure if the message handler is needed...please report if don´t)
* used message and added token support
i think its more flexible with an own module, due to it comes with privatemsg module, its just a click to activate it
Comment #5
fagogreat, code looks good now. You can remove the message argument loading handler, if you move the message argument to be the first entry in the #arguments definition. If there is no handler, it will just use the first passed variable - the message.
I still think, it's unnecessary to be its own module. E.g. the token integration might be useful also for people which don't use workflow-ng. And yes, it's just one click to activate, but it's an unnecessary click. However, I think this has to be decided by the module maintainer anyway ;)
Comment #6
nodestroy commentednow without extra handler for message
Comment #7
fagogreat!
Comment #8
alexkoe commentedThank You for great work.
But i see that token integration does not work.
I debugged it and found that function pm_workflow_ng_action_send_privatemsg should be as follows. Then tokens work well.
/**
* Sends the Privatemsg
*
* @param $user_rep
* Recipient of the Message
* @param $user_sen
* Sender of the Message
* @param $settings
* Associative Array with 'subject' and 'message' as keys
*/
function pm_workflow_ng_action_send_privatemsg($user_rep, $user_sen, $settings,&$arguments) {
// send pm
+ extract( workflow_ng_token_replace_all(array('message', 'subject'), $settings, $arguments, $log) );
+ _privatemsg_send($user_sen, $user_rep, $subject, $message, FILTER_FORMAT_DEFAULT);
- _privatemsg_send($user_sen, $user_rep, $settings['subject'], $settings['message'], FILTER_FORMAT_DEFAULT);
}
Comment #9
Bencoon commentedIt works exactly as needed, with the alteration from Alexkoe. Thank you *so* much for making this, this helps immensely. :)
For the include that sends a private message, is it possible/convenient to add support for adding and having the message sent to a specific sort folder?
Comment #10
webchickbased on #8/#9
Comment #11
nodestroy commentednew patch attached
Comment #12
fagohm, I created some rules for testing each part of the configuration.
First off, when I deleted a pm my rule created that message:
* PM event "Message is deleted" occured for a message of subject and sender user Anonymous and receiving user fago.
Then I when I pruned a message out of the trash, the delete message was shown again. So the delete event occured instead of the prune event.
However looking at the patch, it looks good, as it just passes the message from hook_privatemessage to workflow-ng. So I'm not sure if this are actually bugs of the integration or bugs of privatemsg 2.x? Shouldn't it pass the whole message object in case of deletion too? And shouldn't it use op 'prune' when deleting messages out of the trash?
I attach my exported testing rules, so you can use them to test too.
Comment #13
blucky commentedI'm new on patching. How to patch to my workflow_ng module with pm_workflow_ng_log_new.patch?
I'm confuse with many document or forum here explaining about patch windows or linux. Is it same patching windows and pacthing module?
Thanks.
Comment #14
Fayna commentedYou're just patching the module, not your operating system (Windows, Linux, etc.). To patch a module is different on each OS, that is why they're mentioned. So depending on which OS you have determines how you will patch the module.
For patching a module in Windows: http://drupal.org/node/60179
For patching a module in Mac OS X: http://drupal.org/node/60818
Comment #15
blucky commentedThanks Fayna. I was download patchsetup from http://gnuwin32.sourceforge.net/packages/patch.htm for windows and installed it. I already read the help and guide in it. Still confuse, how to pacth my module using command line patch in my Console(type 'cmd' on Run)?
Can I just copy coding on patch and paste it on my module? But I still want to learn to use patch.
Comment #16
solutiondrop commentedI've tested the patch and so far it looks good. The only big problem that I can tell is that the format of the sent email shows special HTML characters such as:
> That's
instead of
> That's
Has anyone else noticed this? When emails are sent from workflow_ng the characters are correctly displayed.
Comment #17
solutiondrop commentedOf course the special html characters were converted when I posted the last comment. Here they are again:
>and single apostrophes come out as "& # 039;"
Comment #18
solutiondrop commentedSorry, changed the Issue title on accident
Comment #19
marcor commentedJust tested the patch #11 on Drupal 5.x with the privatemsg 5.x-3.0-version, works fine! I did not check all available function, but main functionality (mail on sent pm) is no problem and the action is configurable. IMO this new module pm_workflow_ng can be included in the privatemsg-package.
Comment #20
litwol commentedthank you for your contribution. i will review this.
Comment #21
Daryljames commentedwhat do I do with this? is this a module or a patch or both?
figured it out but couldn't get it to work right...
Comment #22
altparty commentedIs there already some progress on this?
Comment #23
litwol commentedI apologize but support for d5 code have been discontinued. i took great care to provide clean and easy upgrade path from d5 versions to d6. currently only d6 and forward versions will receive *official* support. any volunteers are welcoem to continue offering support for d5 branch on the issue queue.