I've created a 'send tokenised email' action in relation to new comments. The body is like so:

New comment posted by : [comment-author-name]
Comment title : [comment-title]
Comment body : 
[comment-body]

After each new comment is posted the very next screen is blank with the following error message at the top:
Fatal error: Call to undefined function token_replace_all() in /mounted-storage/.../token/token_actions.module on line 126

Any help please.

Comments

greggles’s picture

Title: Token module - 6.10 - Fatal error line 126 » Fatal error line 126 - token_replace_all vs. token_replace_multiple

Perhaps this was a mistake and it should really be token_replace_multiple? Eaton wrote that code and I'm not really sure about how/why it works...

superjacent’s picture

Has anyone else reproduced this error.

greggles’s picture

Status: Active » Fixed
StatusFileSize
new906 bytes

In #253094: "Unable to send mail" with send tokenized e-mail redfox75 mentioned this as well so I've changed it.

seanr’s picture

Version: 6.x-1.10 » 6.x-1.x-dev
Status: Fixed » Needs review
StatusFileSize
new982 bytes

That patch missed two more calls to the same function just a couple lines lower. See attached.

superjacent’s picture

I've manually patched the token_actions file and now the comments are recorded but there is an error message at the top of the page Unable to send e-mail. Please contact the site admin, if the problem persists.

The email address is correct.

From the 'Recent Log Entries' page the error is reported like this Error sending e-mail (from admin@prime357.org to new comment - tokenised).. From the wording of this error message, it appears the 'to' email address is incorrect.

seanr’s picture

superjacent - separate issue for that here: http://drupal.org/node/253094

greggles’s picture

Status: Needs review » Fixed

Thanks, Seanr! Committed to the 6.x-1.x branch.

superjacent’s picture

I've now got it sending an email. The problem now is that there is no body, just the subject line.

greggles’s picture

Let's keep issues focused. This was specifically about problems with a call to a function that was wrong. We need a new issue (or perhaps an existing one covers it) for your current issue.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

thomas23@drupal.org’s picture

Hi.

As promised at #288616: undefined function token_replace_all() in token_actions.module I tested version 6.x.1.11 an can now report that it worked for my case. I successfully used the following tokens on new comment action:

[site-name]
[site-url]
[comment-author-name-raw]
[comment-date]
[comment-m]
[comment-yyyy]
[comment-body]
[comment-nid]

I noticed [nid] didn't work but for my case it wasn't what I wanted anyway.

Cheers.