Closed (fixed)
Project:
Rotor Banner
Version:
6.x-2.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Oct 2009 at 18:50 UTC
Updated:
19 Nov 2009 at 10:30 UTC
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
Comment #1
RonC-1 commentedfile is "rotor.module"
Comment #2
mrfelton commentedThis is fixed in CVS now - thanks.