From 0bf19df7c6443b461d49bf8870c220fa66a31cad Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 11 Jun 2014 09:05:09 -0700 Subject: [PATCH] Fix changeset loading issue for "Download Raw Diff" in Differential Summary: Fixes T5309. Modernize this callsite to use ChangesetQuery and pick up attached objects. Test Plan: Clicked "Download Raw Diff" in Differential. Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T5309 Differential Revision: https://secure.phabricator.com/D9461 --- .../DifferentialRevisionViewController.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php index 61d60332df..60c8f32991 100644 --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -673,16 +673,15 @@ final class DifferentialRevisionViewController extends DifferentialController { DifferentialDiff $diff_vs = null, PhabricatorRepository $repository = null) { - $load_ids = array(); + $load_diffs = array($target); if ($diff_vs) { - $load_ids[] = $diff_vs->getID(); + $load_diffs[] = $diff_vs; } - $load_ids[] = $target->getID(); - $raw_changesets = id(new DifferentialChangeset()) - ->loadAllWhere( - 'diffID IN (%Ld)', - $load_ids); + $raw_changesets = id(new DifferentialChangesetQuery()) + ->setViewer($this->getRequest()->getUser()) + ->withDiffs($load_diffs) + ->execute(); $changeset_groups = mgroup($raw_changesets, 'getDiffID'); $changesets = idx($changeset_groups, $target->getID(), array());