akeeba / engage

Akeeba Engage - Comments for Joomla!™ articles made easy
GNU General Public License v3.0
16 stars 10 forks source link

Update CommentsModel.php #197

Closed colivier closed 2 years ago

colivier commented 2 years ago

Descending sorting (DESC) of comments does not work because the sorting is reversed when comments have no parent.

Sorting should be reversed only when comments have a parent to put child comments back in chronological order

nikosdion commented 2 years ago

Nope, wrong. The only level that can be sorted ascending or descending is the top level. Internal levels can NOT be sorted without either requiring too many requests or breaking reply hierarchy.

I have a site with a few thousand randomly created articles, each article having between 100 and 300 randomly created comments in up to three levels deep. It's easier to see how Engage breaks with what you did on such a site than trying to explain it — and the reason I am creating randomly generated, realistic content for all my extensions. It's funny how many issues you can find out with a heavy dose of realistic data than by trying to anayse the code in theory.