thedevdojo / chatter

Chatter is a Simple Laravel Forum Package
https://devdojo.com/forums
MIT License
900 stars 294 forks source link

Fix bug in ChatterController, posts and discussions ordering #202

Closed terdia closed 6 years ago

terdia commented 6 years ago

A discussion should be ordered by posts and discussions instead of discussions and discussions

Issue: Currently order by posts in config has no effect because the order by clause uses chatter.order_by.discussions.by and chatter.order_by.discussions.by

Fix: update order by clause to use chatter.order_by.posts.order and chatter.order_by.discussions.by

marktopper commented 6 years ago

chatter.order_by.discussions.order is used for sorting the list of discussions while chatter.order_by.posts.order is used to order the posts inside a discussion. Please do not mix the two.

terdia commented 6 years ago

@marktopper I am not missing the two, what I am saying his posts.order is not used in the code you only used discussions twice, correct me if I am wrong

marktopper commented 6 years ago

It's used here.