1
votes

I had situation where I had to create a node by entering its details in mysql node table. I also entered details in node_revision table and my node was created and was accessible to all users. Now when user comments on that node, its entry is created in comment and field_data_comment_body tables but these comments are not visible to the user. Whereas those comments are visible to admin.

I am displaying the comments in the tpl file using $content['comments'] variable. For normal user when this variable is diaplyed the comments array is blank whereas for admin the array has all comments for the node.

I am stuck on this and I am not understanding what I have missed while uploading data. Any help appreciated Thanks

2

2 Answers

0
votes

Permission>Comment>View comments. Is it turned on for auth. users?

0
votes

I think I got it, just did it on my project so when you enter into comments table, field_revision_comment_body and field_data_comment_body. Assuming that everything is ok there (you need to set status to 1 otherwise they will be unpublished and you need to be careful with thread and CID - you need incremental value here). Once I did all this I've also got an empty body section of the comment. After a simple cache clear the comments appeared. Let me know if this helps.