Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This file .inc support events for private message.
Comment | File | Size | Author |
---|---|---|---|
privatemsg.inc_.txt | 4.49 KB | fagati |
Comments
Comment #1
fagocool to see you working on this!
First off, please submit it as patch to the private message module, as it should provide its own workflow-ng integration.
To the patch:
* you don't need your hook entity info implementation, as it contains nothing
* you don't need handlers for entities that are already passed to the event. just set no #handler. But how is it possible that the same $msg has a lot of different entities?
* clean your code up, add a doxygen for the whole file, remove all debug statements, even one which is commented out. check coding style, e.g. its not
'#saved'=>true,'#entity' => 'pm',
but
'#saved' => TRUE, '#entity' => 'pm',
Anyway, is the pm really saved after the event? Then you should pass it by reference. Otherwise remove #saved.
Comment #2
fagati CreditAttribution: fagati commentedOk Thanks.
A question on handler. Why i must leave it. Without handler i can't populate the arguments with value.
if i don't use for example the function privatemsg_arguments_message($msg) how can i use in condintion text comparison for match the message body with a regular expression?
$msg is an object not a string
Comment #3
fagoyou could provide token integration for the message or provide an extra condition for that case. The problem with your arguments is that it is X times the same.