I\'m using Magento\'s layered navigation with my custom attributes and price. If I filter by price it works; but when filtering by my custom attributes it shows:
This causes the same problem. -adding the same attribute to the sort twice when building a collection:
...
->addAttributeToSort('color', 'asc')
->addAttributeToSort('color', 'asc');
NOTE: calling setCollection($this->getMyCollection); on the template caused my error, because 'color' was already added to the sort order as the default sort order.
SOLUTION:a quick way to fix this is to remove the default sort order from the request after obtain the value:
$this->getRequest()->setParam('order','');
otherwise extend the Block and override the setCollection() method for your particular needs.