Due to a type in anon_comment.install the primary key is not created.

CommentFileSizeAuthor
#1 anon_comment.code_.2075955-1.patch780 bytesclemens.tolboom

Comments

clemens.tolboom’s picture

Status: Active » Needs review
StatusFileSize
new780 bytes
clemens.tolboom’s picture

Patch is missing the change to db_insert as that will fail on edit a comment.

-  $query = db_insert('anon_comment_authors')->fields($field_map)->execute();
+  // Update
+  $result = drupal_write_record('anon_comment_authors', $field_map, array('cid', 'uid'));
+  if (!$result) {
+    // Insert
+    $result = drupal_write_record('anon_comment_authors', $field_map);
+  }
clemens.tolboom’s picture

Comment #2 fails somehow. I changed that into

  db_merge('anon_comment_authors')
    ->key($field_map)
    ->fields($field_map)
    ->execute()
  ;