Sort Ponder Answers by voteCount
Summary: Fixes T9207. I think this is correct? Sorts based on vote count and reverses the order of the array so higher is first. Test Plan: Test vote ordering on a number of sample tasks. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T9207 Differential Revision: https://secure.phabricator.com/D13924
This commit is contained in:
@@ -225,9 +225,10 @@ final class PonderQuestionViewController extends PonderController {
|
||||
$xaction_groups = mgroup($xactions, 'getObjectPHID');
|
||||
$author_phids = mpull($answers, 'getAuthorPHID');
|
||||
$handles = $this->loadViewerHandles($author_phids);
|
||||
$answers_sort = array_reverse(msort($answers, 'getVoteCount'));
|
||||
|
||||
$view = array();
|
||||
foreach ($answers as $answer) {
|
||||
foreach ($answers_sort as $answer) {
|
||||
$xactions = idx($xaction_groups, $answer->getPHID(), array());
|
||||
$id = $answer->getID();
|
||||
$handle = $handles[$answer->getAuthorPHID()];
|
||||
|
||||
Reference in New Issue
Block a user