Antispam wasn't sending any notification emails on one of my sites, and after a looong search I tracked it down to the first query in antispam_notify_moderators not returning any results, due to the placeholders for the permissions incorrectly including the wildcards in the query rather than the value (see http://api.drupal.org/api/drupal/includes!database!database.inc/group/da...).

So, in antispam.module starting at line 1380, I changed

' WHERE p.permission LIKE \'%:perm1%\''.
' OR p.permission LIKE \'%:perm2%\'';
$result = db_query($sql, array(':perm1' => $moderator_permission, ':perm2' => $administer_permission));

to

' WHERE p.permission LIKE :perm1'.
' OR p.permission LIKE :perm2';
$result = db_query($sql, array(':perm1' => '%' . $moderator_permission . '%', ':perm2' => '%' . $administer_permission . '%'));

And everything's working great now. I should note, this was working on another of my sites, so I guess it may depend on server stuff (the problem site is running PHP 5.3.20 and MySQL 5.5.30, for what it's worth). I also realize this module is not currently maintained, and apologize for not creating a proper patch, but thought I'd create an issue just in case this helps anybody else!

Comments

  • cfinke committed ff36bd4 on 7.x-1.x
    Issue #1995038 by tinkerbelle: Emails not sending -- query in...
cfinke’s picture

Issue summary: View changes
cfinke’s picture

Status: Active » Fixed

Committed, thanks for the fix!

Status: Fixed » Closed (fixed)

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