-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
Description
I have a form with a collection of images. The user can re-order the images. I am using Doctrine2's Criteria for sorting the images.
public function getImages()
{
$criteria = Criteria::create()
->orderBy(array('rank' => Criteria::ASC, 'id' => Criteria::ASC));
return $this->images->matching($criteria);
}
If the form is submitted and contains an error, the images are not loaded in the order submitted by the user. FYI, I am sorting the rank as a hidden field. The user drag/drops which updates the hidden rank in the html.
I am pretty sure this was working correctly when I found it here: #8315
The Criteria class should re-order the collection using logic, rather than a query since the query has already been run.