It appears that in comment_resource.inc on line 188 the creation of the empty comment object should include the pid (parent ID) value if provided by the request for the comment_form to properly process threaded comments.
$comment_empty = (object) array(
'nid' => $comment['nid'],
'cid' => NULL,
);
should be
$comment_empty = (object) array(
'nid' => $comment['nid'],
'cid' => NULL,
'pid' => $comment['pid'],
);
This appears to work in our limited testing and appears to pass the pid into the comment_form successfully for threading to occur.
Comments
Comment #1
marcingy commentedThe solution is actually bit more complex as we need to check if a pid is provided.
Patch also adds a check to ensure that nid is provided when creating a comment which is currently missing.
Comment #2
kylebrowning commentedComment #3
kylebrowning commentedFixed.