Closed (fixed)
Project:
Facebook Comments Social Plugin
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Nov 2011 at 22:42 UTC
Updated:
25 Jan 2012 at 15:05 UTC
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.)
| Comment | File | Size | Author |
|---|---|---|---|
| 0001-Bug-Fixes-Play-nice-with-existing-nodes.-Code-tidy-u.patch | 8.22 KB | jackread |
Comments
Comment #1
wmostrey commentedI committed the fix and cleaned up the comments.
Linebreaks don't conform the coding standards so I left those out.
Comment #2
wmostrey commentedComment #4
wmostrey commentedI updated the code to use db_merge() instead of drupal_write_record().