- Affected version
- 2.3.9
Finder::standardizeOrderingValue() doesn't correctly handle the direction argument, and this results in the multi-column sorting via the
Suppose an add-on defines a new multi-column sort option like so;
If this custom sort is then a thread default, the Finder::setDefaultOrder is called like this:
But this generates this SQL
This makes defining custom multi-columns filtering via
ThreadRepository::getDefaultThreadListSortOptions not working as expected.Suppose an add-on defines a new multi-column sort option like so;
PHP:
public function getDefaultThreadListSortOptions($forAdminConfig): array
{
$options = parent::getDefaultThreadListSortOptions($forAdminConfig);
$options['MyNewColumn'] = [
['MyNewColumn'],
['last_post_date'],
];
return $options;
}
If this custom sort is then a thread default, the Finder::setDefaultOrder is called like this:
PHP:
$finder->setDefaultOrder([
['MyNewColumn'],
['last_post_date'],
], 'desc');
SQL:
order by MyNewColumn asc, last_post_date asc
This makes defining custom multi-columns filtering via
getDefaultThreadListSortOptions basically impossible, as the direction filter option is ignored.
Last edited: