If you install the module after you have already created nodes you can't enable comments on any of those nodes.
The problem is... a result of using db_insert() in hook_node_insert()... you cant create a new row if you are updating the node.

I've attached a patch that uses drupal_write_record() instead and handles creating a new row if you are updating the node .

The patch also includes some tidyups (linebreaks etc.)

Comments

wmostrey’s picture

I committed the fix and cleaned up the comments.

Linebreaks don't conform the coding standards so I left those out.

wmostrey’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

wmostrey’s picture

I updated the code to use db_merge() instead of drupal_write_record().