Re. #986582: Compatibilty with nodecomment module Translation Management will trigger the node save, and nodecomment too, resulting in two calls for node_save and two insert queries for the same row. The following patch will check the exsisting of the row before inserting it.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 986586-1.patch | 1.61 KB | good_man |
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