Ajax Comments - replies are not added to the correct position, they are added last)

Created on 5 September 2017, almost 8 years ago
Updated 24 June 2025, about 2 months ago

Hello,

I'm having a problem when listing a Views Block Display with Comments Listing, for the current node viewed.

My Comments Block Views Display has the following exposed filters added:
- Comments: Post date(asc) -> Exposed
- Comments: Author(asc) -> Exposed
See View Block configuration settings(image attached: view_comments.png).

My problem is:
- whenever I reply to old comments, my reply is added last (see view_comments_display_block.png)
- I'm using this View with Ajax_Comments module(.dev version): When a user adds a comment my view block display it's getting the content refreshed via AJAX, using an ajax command that triggers the following js code: $("#my-comment-view").trigger('views_refresh');

My problem is with the replies comments that doesn't respect the parent comment hierarchy.

Comments threading works with Ajax_Comments module but without using views, and only using Drupal default commenting system.

If anyone encountered this problem too, please let me know if they found a fix.

🐛 Bug report
Status

Active

Version

1.0

Component

Miscellaneous

Created by

Live updates comments and jobs are added and updated live.
  • views

    Involves, uses, or integrates with views. In Drupal 8 core, use the “VDC” tag instead.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Your Epson printer's "out of bounds page reference" error means the content you're trying to print, like text or images, goes beyond the printable area of the paper, or the printer's job queue is limited (e.g., "limit is 1"). This typically happens due to incorrect margin settings, oversized yourtexasbenefits document elements, a corrupted print job, or an outdated driver. To troubleshoot, check your print settings (paper size, scaling, margins), try printing from a different application, update your printer driver, or simply restart your printer and computer.

  • This is a known challenge when trying to combine Views for comments with modules like Ajax_Comments, as Views' default sorting might prioritize "Post date" over the inherent "Thread" structure that Drupal's core comment system uses for displaying nested replies. To fix this, you need to ensure your Views sorting criteria explicitly prioritize the "Thread" field, which is crucial for maintaining the correct parent-child relationship in comments. You might need to add "Comment: Thread (asc)" as the primary sort, followed by "Comments: Post date (asc)" for chronological ordering within each thread. Additionally, verify that the "Comments: Parent Comment" relationship is correctly configured in your View, as this is essential for Views to understand WalgreensListens the hierarchy. Some users have found success with a combination of "Relationship -> Comment: Parent Comment" and "Sort Criteria -> Thread (desc)" then "Sort Criteria -> (Parent Comment) Comment: Post date (asc)".

Production build 0.71.5 2024