Download & Extend

Node updates are not reflected in node_comment_statistics correctly

Project:Drupal core
Version:7.x-dev
Component:comment.module
Category:bug report
Priority:minor
Assigned:Unassigned
Status:needs review

Issue Summary

Hi,
So, I have written a forum topic as my first user, "webmaster" one. So on the front page in last message infos it was displayed: last message by "webmaster" on ...

Then I change my mind, I edit my forum topic, and put as a writer another user. But the forum front page is not changed and still displays "last message : webmaster".

Thanks

Comments

#1

Priority:normal» critical

Moreover if I create a new article in the same forum, the "last message" window is not updated accordingly, it is still the first message which is displayed. And this is critical.

Thanks

#2

I don't think it is critical, but I think it is fixed by a patch I committed a few minutes ago:

http://drupal.org/node/54098

#3

Priority:critical» normal

Indeed for the second part, I just saw it.
But there is still the issue where when you change the author of a forum node, the author is not changed in the "last message" column. But I agree this is not critical.

#4

This would require actually changing the results in the node_comment_statistics page.

I suggest the following workaround: If you change the author of a forum post, try then posting a comment and then deleting the comment. That should force the table to be properly rewritten. If that workaround works, then the bug should be reduce to minor.

#5

I'll try, but I don't understand, I cannot post any comment to a forum topic even if the topic is displayed with "comment enabled reading/writing". I have not the link "new comment"...
It works with other nodes, but not with forums... perhaps I missed something somewhere?

#6

I think you can change what node types can have comments at admin/node/configure.

You can also directly edit that node and check to see if comments are enabled/disabled for that node.

#7

Priority:normal» minor

Ok, if I create then delete a comment, the author changes is updated...

#8

Is this still a bug?

#9

Version:x.y.z» 7.x-dev

Just tested with Drupal 6 RC3 and this is still a bug. As it won't get into six am bumping version up to seven. Worth noting: if #148849: Merge {node_comment_statistics} into {node} happens we'll get this bug fixed for free.

#10

Title:Changing user does not change forum front page» Node updates are not reflected in node_comment_statistics correctly
Component:forum.module» comment.module
Status:active» needs review

I confirmed that this was still an issue in D7. I created forum node, viewed /forum, changed node's author, and confirmed that the change was not reflected at /forum.

Issue #148849: Merge {node_comment_statistics} into {node}, referenced above, is scheduled for D8 now.

Here's a patch which implements hook_node_update() for the comment module to complement what already happens with hook_node_insert(). This function will update the node's author and/or node creation date in the {node_comment_statistics} table in the event that the node changes before comments have been added to it. This will cause dependent views (such as the forum page) to show the correct information.

Related Issues:
#273157: Comment last updated is wrong if authoring date is changed

AttachmentSizeStatusTest resultOperations
node_comment_statistics-55246-D7.patch1.06 KBIdlePASSED: [[SimpleTest]]: [MySQL] 26,744 pass(es).View details | Re-test

#11

Status:needs review» needs work

The last submitted patch, node_comment_statistics-55246-D7.patch, failed testing.

#12

Status:needs work» needs review

#10: node_comment_statistics-55246-D7.patch queued for re-testing.

#13

It is really weird that last_comment_timestamp has any value when there are no comments. and its annoying to keep it up to date. just adds another write query to update which is important in data migration scenarios.

so, is there no way to leave stuff blank when comment_count = 0. as is, we are lying.

#14

We're not lying, we're just counting from 0 instead of 1; the node itself being the "0th" comment.

nobody click here