digitalpoint
Well-known member
- Affected version
- 2.2.7
Comments in reports are out of order (sometimes), with new ones inserting themselves into random places. Turns out, the report comments aren't being sorted when they are queried.
In
Currently:
Maybe change to this to get a consistent order?
Currently I see this:
Probably not overly noticeable because of how InnoDB adds new records to the end of the table (normally) so a "no order" will usually (but not always) will return in record insertion order. But that can't be relied on.
In
XF\Pub\Controller\Report
Currently:
PHP:
$comments = $report->getRelationFinder('Comments')->with('User')->fetch();
Maybe change to this to get a consistent order?
PHP:
$comments = $report->getRelationFinder('Comments')->with('User')->order('comment_date')->fetch();
Currently I see this:
Probably not overly noticeable because of how InnoDB adds new records to the end of the table (normally) so a "no order" will usually (but not always) will return in record insertion order. But that can't be relied on.
Last edited: