Steps to reproduce :
- create an article node
- add a comment '1' as a comment to the OP
- add a comment '2' as a comment to the OP
- add a comment '2-1' as a reply to comment 2
- add a comment '1-1' as a reply to comment 1

Expected display for the threaded comments:
- 1
-- 1-1
- 2
-- 2-1

Actual display:
- 1
- 2
-- 2-1
-- 1-1

Comments

Toktik’s picture

Same bug here. Using HEAD.

SQL query in comment_render() is normal. Any other instance for this bug?

marcingy’s picture

Status: Active » Needs review
StatusFileSize
new2.58 KB

The issue is being caused in comment_load_multiple. The array is loaded correctly in comment_render, however the order is forgotten when we load the comment collection. This patch introduces a new parameter that can be passed into comment_load_multiple to allow for orderby statements, and removes the original ordering in comment render as it does 'nothing'. Initial patch supplied to fix the issue.

Status: Needs review » Needs work

The last submitted patch failed testing.

damien tournoud’s picture

Nice catch, but the correct fix is to make sure that comment_load_multiple() respect the order of the cids it receives, the same way that node_load_multiple() does respect the order of the nids it receives.

catch’s picture

Status: Needs work » Needs review
StatusFileSize
new8.62 KB

Untested patch which does that. Looks like we don't have tests for the order of threaded comments, hoping it might just be a couple of asserts / strpos in the existing tests.

Status: Needs review » Needs work

The last submitted patch failed testing.

tylor’s picture

Patch from #5 applied fine but problem still exists; followed steps from original post.

yched’s picture

Status: Needs work » Needs review
StatusFileSize
new860 bytes

Patch #5 had unrelated hunks. Simple repost, I did not even test, don't credit me.

(ps: lol at ? bottle.patch)

andypost’s picture

Status: Needs review » Needs work

I've tested a patch - comments still posts under last thread.

Screens in my duplicate issue #529374: Reply on comment is broken

marcingy’s picture

Status: Needs work » Needs review
StatusFileSize
new782 bytes

Change the operation on the array as we have 0 key and placement issues in the array

Status: Needs review » Needs work

The last submitted patch failed testing.

tylor’s picture

Status: Needs work » Needs review
StatusFileSize
new874 bytes

Tested #10 and comments were threaded as expected. Patch failed to apply, re-rolled from root.

andypost’s picture

This patch (#12) applies cleanly and now comments displays in right way.

+1 to rtbc this after bot happy!

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Looks like everything fine and 3 opinions to rtbc

webchick’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Sorry, but we will need some tests for this. Otherwise, we're likely to break it again.

damien tournoud’s picture

Title: comment threading broken » Comment threading broken
Status: Needs work » Needs review
StatusFileSize
new5.63 KB

This was nearly fixed by the entity patch. Only nearly, because a condition was wrong in DrupalDefaultEntityController::load(). We actually need to fix the ordering of the result set even when the cache is not enabled.

Here is a patch + test.

catch’s picture

Status: Needs review » Reviewed & tested by the community

Very nice.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Awesome! Thank you very much. Committed to HEAD.

Status: Fixed » Closed (fixed)
Issue tags: -Needs tests

Automatically closed -- issue fixed for 2 weeks with no activity.