I've got content type with couple of cck fields like Text, Integer, Money, Phone, Email).
I've assigned new action "Send tokenized e-mail..." on Trigger 'After saving a new post' ,
Then every submit of this node generates: "Internal Server Error"

Nothing in error logs or watchdog.
Any clue?

Comments

kenorb’s picture

kenorb’s picture

Project: Drupal core » Token
Version: 6.x-dev » 6.x-1.x-dev
Component: trigger.module » Code
Category: support » bug

It's because 'Recipient:' is not required field as in normal 'Send email...' action.
If you leave it empty, it generates Internal Server Error.

kenorb’s picture

Status: Active » Needs review
StatusFileSize
new963 bytes

This could be done by hook_validate as it's done already in system module.

kenorb’s picture

Title: Internal Server Error on trigger After saving a new post » Internal Server Error on Send tokenized e-mail trigger
greggles’s picture

Kenorb - does this fix the issue for you?

Also, I tried to duplicate the steps and couldn't get the error as you describe. Can you clarify the full steps to repeat?

kenorb’s picture

Yes, it solved my issue.
When first I saw this error, I used Workflow.
I've created Workflow, with state 'new'. Added permission to create this state for Anonymous, and then assigned action when specified content is created and when it have a 'new' state, then send tokenized e-mail.
So I started to diagnose the problem, so I've disabled Workflow module and assigned action directly on Node creation, so I still had a problem on submitting this form.
So I edited tokenized e-mail action, and I thought before that if I leave Recipient empty it will be set to my site_mail. But when I set Recipient to some non-empty e-mail then it worked - no error anymore.
I don't know why you can't reproduce it. Try to create two tokenized e-mail actions, I had two of them, but only one was assigned.
Internal Server Error could depends on the server configuration, maybe some other connection or some conflicts between some modules.

Basically the problem was Internal Server Error on submitting content when "Send tokenized e-mail..." action was assigned, and it was solved when I've put some e-mail in Recipient field.

So the question is, if you allow it to be empty, so to what address it will send the e-mail?

kenorb’s picture

I'll try to reproduce it on the other website and somebody will have similar problem.

greggles’s picture

All I needed was the advice as you gave in #6 to reproduce the error in a very simple way. I don't have time for this right now, but will try to test soon.

dave reid’s picture

Status: Needs review » Postponed (maintainer needs more info)

Is this still an issue?

greggles’s picture

Status: Postponed (maintainer needs more info) » Needs review

I imagine it is.

Status: Needs review » Needs work

The last submitted patch, token_actions.module.patch, failed testing.

dave reid’s picture

Component: Code » Token Actions
dave reid’s picture

Status: Needs work » Needs review
StatusFileSize
new989 bytes

Simple patch for review.

dave reid’s picture

Note we just have to do #required => TRUE on the form element itself rather than validation seeing as the recipient may be any token possible.

dave reid’s picture

Status: Needs review » Fixed

Committed #13 to CVS. Thanks all!
http://drupal.org/cvs?commit=452416

Status: Fixed » Closed (fixed)

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