The use of "ON DUPLICATE KEY" which is a mysql-specific thing prohibits the use of this module with other databases.

This patch should work with pretty much every database:

Starting line 427, it should be:

function _rotor_save(&$node) {
  if (!$node->nid) return;
  $fid = 0;
  if (is_object($node->rotor_image)) {
    $fid = upload_element_save($node->rotor_image, 'rotor', FILE_EXISTS_RENAME);
  }
  $exists = db_fetch_object(db_query("SELECT 1 FROM {rotor_item} WHERE nid = %d", $node->nid));
  if($exists)
    db_query("UPDATE {rotor_item} SET fid=%d, alt_text='%s', image_title='%s', url='%s', link_target='%s' WHERE nid = %d",
     $fid, $node->alt_text, $node->image_title, $node->url, $node->link_target, $node->nid);
  else
    db_query(
      "INSERT INTO {rotor_item} (nid, fid, alt_text, image_title, url, link_target)
      VALUES (%d, %d, '%s', '%s', '%s', '%s')"
      ,$node->nid, $fid, $node->alt_text, $node->image_title, $node->url, $node->link_target);
}

Comments

RonC-1’s picture

Status: Patch (to be ported) » Needs review

file is "rotor.module"

mrfelton’s picture

Status: Needs review » Fixed

This is fixed in CVS now - thanks.

Status: Fixed » Closed (fixed)

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