Wikia/app — pull request #1638 by nmonterroso (2013-10-01 10:36:58+00:00)
Title: respect $order when formatting results in ImageServingDriverBase

@Wikia/platform-team
https://wikia-inc.atlassian.net/browse/BAC-734

Issue here is that we were fetching/storing the order for images on a page (so main image is always first), but we were ignoring that order when we were building the final list. This has the potential to lead to non-main images on top lists (see https://wikia-inc.atlassian.net/browse/BAC-734) when images appeared in more than one article.

This change changes the default behavior for all ImageServingDriverBase classes (ImageServingDriverMainNS, ImageServingDriverUserNS, ImageServingDriverFileNS, ImageServingDriverCategoryNS) but seems safe from a functionality standpoint (though I'd like someone more familiar with this to verify). It has a small perf impact sine we're now paying the price for a ksort and looping over images again, but since this data is cached it's probably ok.