A new Extension, “Akismet Spam Filtering” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

Allows you to pass data from the front end through the Akismet Spam service. Be sure to read the enclosed README.txt file first. The way this Extension works in Symphony 2 is different to the 1.7 counterpart.

Get the latest version from git

Changes in 1.2

  • Uses the "Akismet CURL Class", written by David Pennington, for connections to the Akismet server. This is faster than using fsockopen. Thanks to nickdunn for finding it.

Note: This extension requires Revision 5

I don't think this is working. I enabled it and selected it in the Save Comment Filter Rule and it always return an error when I try to write a comment. After taking it out, the comments seem to work again. Was this how I was supposed to use it? I'm running R5.

what kind of error do you get?

It's not a PHP error, there's just a red box by the comments area saying there was an error posting the comment.

I have my Wordpress key set and everything as well.

Here is the exact error message:

The system encountered errors when saving your comment. Please check if all the required fields have been filled.

On the page where the error message is shown, could you please take a look at the source code. At the bottom there should be the response XML of the event in a comment with the reason why your comment wasn't saved. Something like:

<!-- <event>...</event> -->

I feel dumb. It's showing this:

Author, Email and URL field mappings are required.

I don't really know where to tie that in with the the data that is posted.

No problem. Just take a look at the Askismet documentation:
Go to Blueprints > Components > Events > Your-event-to-save-comments.

When you scroll down you'll find the needed documentation, in this case:

In order to provide Akismet with a correct set of data, it is required that you provide field mappings of Author, Email and URL. The value of these mappings directly point to values in the fields array of POST data. To specify a literal value, enclose the hidden fields value attribute in single quotes. In the following example, author, website and email would correspond to fields[author], fields[website] and respectively:

<input name="akismet[author]" value="author" type="hidden" />
<input name="akismet[email]" value="''" type="hidden" />
<input name="akismet[url]" value="website" type="hidden" />

You need to add the hidden input fields mentioned to your comment form. You need to change the values of all three input fields to the corresponding fields of your comment form (I don't have Spectrum installed, but I think it is author, email and website for the standard theme).

Try again and post a comment - if all went fine it should work now.

I have done all those, here is my current form:

<form action="" method="post">
<xsl:for-each select="events/save-comment">
<p class="{@result}">
<xsl:when test="@result = 'success'">Your comment has been saved successfully.</xsl:when>
<xsl:otherwise>The system encountered errors when saving your comment. Please check if all the required fields have been filled.</xsl:otherwise>
<xsl:text>Name </xsl:text>
<input type="text" name="fields[author]" value="" />
<xsl:text>Email </xsl:text>
<input type="text" name="fields[email]" value="" />
<xsl:text>Website </xsl:text><small>http://</small>
<input type="text" name="fields[website]" value="" />
<xsl:text>Comment </xsl:text>
<textarea name="fields[comment]" rows="5" cols="21"></textarea>

<input name="fields[article]" value="{articles/entry/@id}" type="hidden" />
<input name="akismet[author]" value="author" type="hidden" />
<input name="akismet[email]" value="email" type="hidden" />
<input name="akismet[url]" value="website" type="hidden" />
<input id="submit" type="submit" name="action[save-comment]" value="Post Comment" />

And it's still not working? Hmm ...
Have you double checked your API key?

Yeah. It would tell me if my API key is working or not wouldn't it. Here's the exact error:

<save-comment result="error">
<filter name="akismet" status="failed">Author, Email and URL field mappings are required.</filter>
<message>Entry encountered errors when saving.</message>

The site is at twinarrow dot com.

I don't have any idea ...

Sorry for asking: You did enter a name, email and website before submitting your form, did you?

Haha, yes I did.

Okay ;)
Let's wait for Alistair then

I am not having any problems on our Dev copy. At line 104 of /extensions/akismet/extension.driver.php put the following:

print_r($_POST); print_r($mapping); die();

and post the output here. It will show up when you try to save a comment.

Actually, mapping is not being set at all.

$mapping = $context['post']['akismet'];
print_r($_POST); print_r($mapping); die();
if(!isset($mapping['author']) || !isset($mapping['email']) || !isset($mapping['url'])){
    $context['messages'][] = array('akismet', false, 'Author, Email and URL field mappings are required.');


    [fields] => Array
            [author] => Huy
            [email] =>
            [website] =>
            [comment] => test test testing
            [article] => 185

    [akismet] => Array
            [author] => author
            [email] => email
            [url] => website

    [action] => Array
            [save-comment] => Post Comment


I changed it from

$mapping = $context['post']['akismet'];


$mapping = $_POST['akismet'];

and that works.

Strange... where did $mapping = $context['post']['akismet']; come from? This is not in our dev code at all. It should be $mapping = $_POST['akismet'];, hence why it started working for you.

Edit: Odd. Its in the archive I posted above. Perhaps I realised that was a problem and changed it locally, but forgot to post the change here. I'll do that shortly

I have posted updated code above (v1.2).

Can I suggest a Columbia Crest Grand Estates Merlot 2001 or 2004 to help you focus?

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details