System action (email) triggered by workflow failed because the $node object was not set properly

hanoii - January 12, 2009 - 20:33
Project:Workflow
Version:6.x-1.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I have an email action configured to send an email to the author of a node. I wanted to trigger that action when changing from one state to another but the email was not properly set. By looking at the code of the email action (system.module), I noticed that it expects the $node object directly as the $object argument of the do_action() function, when the action type is 'system'.

Attach is a patch that fixes this.

- Drupal 6.8 / PHP Version 5.2.6-0.1~lenny1 / Debian 5.0 (testing)

AttachmentSize
workflow.module.patch721 bytes

#1

Ninja Overlord - February 15, 2009 - 01:01

Works well for me, thanks!

#2

RdeBoer - February 17, 2009 - 23:19

And for me...! Well-spotted hanoii!
Much appreciated.

#3

cYu - April 14, 2009 - 22:02
Status:needs review» needs work

This had the unwanted side effect of breaking token replacement on e-mail actions of type system when applied to my install. E-mail body went from...

Node created at localhost:8888/mysite/node/16421
to
Node created at localhost:8888/mysite/node/[nid]

after I applied this patch.

#4

westbywest - June 4, 2009 - 19:18

subscribing

#5

seanburlington - July 22, 2009 - 10:48

Works for me

Thanks :-)

#6

jenlampton - August 3, 2009 - 20:49
Status:needs work» needs review

Works for me. I set up a clean install of drupal 6.13 + workflow 6.x-1.1 + this patch + token 6.x-1.x-dev and was unable to reproduce the problem in #3. Is anyone still having problems with this patch?

Jen

#7

blade_rsw2003 - October 6, 2009 - 13:38

Love the patch, work like a charm

really appreciate, all the best Haonii

#8

anawillem - October 15, 2009 - 02:15

awesome. worked for me. wonder why this hasn't been fixed in the newest version? are other folks having the same issue? in any case, it fixed it for me. thanks for this - so much.

#9

anawillem - November 5, 2009 - 21:07

Still not fixed in the newest release of workflows module (oct 23rd?) for 6.x (I just implemented it on monday, and it broke this again). Is anyone paying attention to this post?

#10

taoliu - November 12, 2009 - 19:46

Thanks a lot! It worked great and fixed my problem that some token variables in emails were not replaced. I am using the newest release of workflow and have not encountered any issue mentioned above.

 
 

Drupal is a registered trademark of Dries Buytaert.