MG 2.1 Finder Mediaitem.php

Twincam

Member
Hi All

I have changed orderByDate in Finder Mediaitem.php as follows because this is the only sequence we want. All looked fine. I have now spotted an issue with the thumbnail slider that comes up when you are looking at an image within a category. It looks like that isn't following the same sequence? Is there another place where the sequence of Media Items is set?

Thanks

public function orderByDate($order = 'rating_sum', $direction = 'DESC')
{
$this->setDefaultOrder([
['rating_sum', 'DESC'],
['title', 'ASC'],
['media_date', 'DESC']
]);

return $this;
}
 
The order can be set from anywhere that creates a finder object using order(), whereas orderByDate() simply sets up a default order if no other order is specified. However, patching order() is a fairly obtuse solution and would probably cause unexpected behavior and problems. You'd probably want to patch the places which consume the finder and set the order you want there instead.
 
Back
Top Bottom