When new nodes are created (successfully!) via email, the following two errors are logged in the drupal log:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'references LIKE '%%'' at line 3 query: SELECT parent_message_id FROM og_mailinglist_source WHERE references LIKE '%%' in /var/www/vhosts/bar.org/httpdocs/sites/all/modules/contrib/og_mailinglist/og_mailinglist_api.inc on line 231.

followed by:

Duplicate entry '17-1' for key 1 query: INSERT INTO og_mailinglist_thread VALUES (17, 1) in /var/www/vhosts/bar.org/httpdocs/sites/all/modules/contrib/og_mailinglist/og_mailinglist_api.inc on line 93.

Doesn't seem to affect the successful posting of the node, but still a strange error. Otherwise no errors at all when posting to the groups via the website, or comments via email or via the website.

(version pulled saturday from git)

Cheers,

Tobias

Comments

kyle_mathews’s picture

A fix for the first error is here: http://github.com/KyleAMathews/og_mailinglist/commit/526e6562d45854ff003...

The second is a bit more tricky. The og_mailinglist_thread table holds user's subscriptions to each thread. When a new node is created, everyone in that group is added to this table. But the error I see is that only one group member is being inserted twice. From what I see, it's always the author of the node whose uid is inserted twice. Which points to this bit of code in our implementation of hook_nodeapi()

    // User might not be automatically subscribed to new threads. Subscribe now if they aren't signed up to get emails normally.
    if (og_mailinglist_get_group_subscription_type($group_node->nid, $node->uid) != "email") {
      og_mailinglist_save_thread_subscriptions($node->nid, array($node->uid));
    }

So the person should only get added if they don't subscribe to group emails, e.g. so they'll get replies to their post here.

Anyways, I can't see what's wrong with the above code, the check does work from my testing. Plus the sql error doesn't come up consistently. So I'm going to ignore the error for now.

kyle_mathews’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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