Closed (works as designed)
Project:
Node Comments
Version:
6.x-2.0-beta6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Dec 2010 at 21:00 UTC
Updated:
25 Jun 2011 at 05:22 UTC
Jump to comment: Most recent file
Comments
Comment #1
good_man commentedComment #2
crea commentedThe check for existing row is already there:
if (db_affected_rows() == 0) {I don't understand what are you trying to improve here ?
Comment #3
good_man commenteddb_affected_rows() will return 0 if you are trying to update the same row, to explain it better, db_query("UPDATE") will return 0 if it's trying to update a row with same info:
Example:
UPDATE `node_comments` SET `nid` = 14 WHERE `cid` = 34will return 0 if there is a row with nid = 14
so updating the same row again will return 0, in this case we will go again to the insert query and get a big warning about trying to insert two rows with same primary key.
Comment #4
good_man commentedany second look at the proposed patch as the other patch #986582: Compatibilty with nodecomment module is now commited and released in Translation Management.
Comment #5
good_man commentedComment #6
crea commentedOnly if you have broken database setup (buggy drivers or misconfiguration). For the explanation, see http://drupal.org/node/1088106#comment-4567188