I've import nodes from old site, after changing node-type from custom to faq I cant edit node
This because faq_update which is not checking result of update
Fix is to add db_affected_rows and call faq_insert if no rows updated

function faq_update($node) {
  if ($node->revision) {
    faq_insert($node);
  }
  else {
    db_query("UPDATE {faq_questions} SET question = '%s' WHERE nid = %d AND vid = %d", $node->title, $node->nid, $node->vid);
+    if (!db_affected_rows()) {
+    	faq_insert($node);
+    }
  }
}
CommentFileSizeAuthor
#1 faq_update.patch608 bytesandypost
faq_update.patch607 bytesandypost

Comments

andypost’s picture

Status: Active » Needs review
StatusFileSize
new608 bytes

Code style fix (\t replaced by spaces)

stella’s picture

Status: Needs review » Fixed

Committed, thanks! Will be included in the next release. Back-ported to Drupal 5 also.

Cheers,
Stella

Status: Fixed » Closed (fixed)

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

stella’s picture

Released in 5.x-2.12 and 6.x-1.8.