kieranbarnes Independent PHP, WordPress & CubeCart Programmer

WP-O-Matic Bug Fixes Round Up

Posted on July 16, 2008

I've run into quite a few issues in the latest 1.0RC3-7 release of WP-O-Matic. Here's a round up of the bug fixes and addons you need to actually this potentially useful product useful!
Also, it includes a well known MySQL bug fix.

The well known MySQL bug fix is a fix for the following SQL errors,

WordPress database error 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 ' feed_id = 1, hash = 178e9c301b4781e2c7248ed115802291995cd2b6'' at line 2 for query SELECT * FROM `wp_wpo_campaign_post` WHERE campaign_id = 1, feed_id = 1, hash = '178e9c301b4781e2c7248ed115802291995cd2b6'  made by isDuplicate

And/Or

WordPress database error Unknown column 'hash' in 'field list' for query INSERT INTO wp_wpo_campaign_post (campaign_id, feed_id, , post_id, hash) VALUES ('1','1','4300','9b79457042fd10a210da6110ecfdbed0ed1d45c9') made by processItem

The problem is that MySQL doesn't like the commas in the multiple where clauses. You need to edit wpomatic.php

Find the isDuplicate() function

 function isDuplicate(&$campaign, &$feed, &$item)
{
global $wpdb;
$hash = $this->getItemHash($item);
$row = $wpdb->get_row("SELECT * FROM `{$this->db['campaign_post']}`
WHERE campaign_id = {$campaign->id}, feed_id = {$feed->id}, hash = '$hash' ");
return !! $row;
}

and replace with

 function isDuplicate(&$campaign, &$feed, &$item)
{
global $wpdb;
$hash = $this->getItemHash($item);
$row = $wpdb->get_row("SELECT * FROM `{$this->db['campaign_post']}`
WHERE campaign_id = {$campaign->id} and feed_id = {$feed->id} and hash = '$hash' ");
return !! $row;
}

Here's the previous fixes.

WP-O-Matic Cron Hangs

WP-o-Matic Upgrade Fix

WordPress WP-O-Matic Duplicate Posts Fix

This is my modified wpomatic.php file -> Direct Download


Related posts

  1. WordPress WP-O-Matic Duplicate Posts Fix
    Got a problem with WP-O-Matic creating duplicate posts? Or just WordPress in general. Me too....
  2. WP-o-Matic fix for WordPress 2.5
    WP-o-Matic makes autoblogging a easy by automatically creating posts from the RSS/Atom feeds you give...
  3. CubeCart and WordPress Integration
    Following my 100% CubeCart orientated posts, here's another late night hack. It integrates a WordPress...
  4. WP-o-Matic Upgrade Fix
    So I rolled out some WP-o-Matic upgrades recently. I was all excited that version 1.0RC3-7...
  5. WP-O-Matic Cron Hangs
    Does your WP-O-Matic hang sometimes when processing feeds? It's probably trying to a ping back...

Comments (4) Trackbacks (1)
  1. Hi Did you ever do any more work on this plugin? Mine was working fine now however in the posts where the con

    tent should be is only the word content in brackets like this {content} i dont think wpomatic plugin is supported any longer I have asked for help and never got any response this week at all..

  2. what about tags in the titles? i notice that wpomatic does this automatically for all of my post titles around the campaign title words. Is there a way to fix this?

  3. what about bold [b] tags in the titles? i notice that wpomatic does this automatically for all of my post titles around the campaign title words. Is there a way to fix this?

  4. i have the same question as oli. is there a fix for this?


Leave a comment

(required)