Active
Project:
Drupal core
Version:
main
Component:
comment.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 May 2013 at 03:28 UTC
Updated:
5 Aug 2024 at 00:54 UTC
Jump to comment: Most recent
We tried to generate 50 flat comments via devel. Devel created them nested.
We tried to update the pid by using:
foreach ($comment) {
$comment->pid->value = 0;
comment_save($value);
}
That did not work as comments were still threaded.
But the pid in DB table "comment" had changed to 0 ...
There should be a way to reset the parent of a comment.
Comments
Comment #9
catchWould be good to manually verify whether this is still valid, then write some tests for this. My guess would be $comment->thread not being updated.
Comment #13
catchComment::preSave() thread logic only happens when $comment->isNew(). So the question is - do we want to remove that condition so that if the pid of a comment changes, the thread is automatically updated. I guess we could check $comment->original for a change in the parent and only do the logic if it's changed, would save doing those calculations when comments are just normally edited.
Comment #16
quietone commentedI think this needs an issue summary update to explain the work for it to be suitable for a novice.