From a1d1c69506774fce55a5a01395d66513d3bc9aa1 Mon Sep 17 00:00:00 2001 From: mgummelt Date: Wed, 31 Aug 2011 17:54:45 -0700 Subject: [PATCH] diff dict API bug fix Summary: I didn't realize createDiffDict was a public method when I modified it, and I broke the API call in getrevision. This moves the modification inside the method and reverts the method header back to it's original form. Test Plan: none Reviewers: epriestley Reviewed By: epriestley CC: edward, aran, epriestley Differential Revision: 883 --- .../ConduitAPI_differential_getdiff_Method.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/applications/conduit/method/differential/getdiff/ConduitAPI_differential_getdiff_Method.php b/src/applications/conduit/method/differential/getdiff/ConduitAPI_differential_getdiff_Method.php index 0fa0ea340f..c174d3179d 100644 --- a/src/applications/conduit/method/differential/getdiff/ConduitAPI_differential_getdiff_Method.php +++ b/src/applications/conduit/method/differential/getdiff/ConduitAPI_differential_getdiff_Method.php @@ -72,15 +72,10 @@ class ConduitAPI_differential_getdiff_Method extends ConduitAPIMethod { $changeset->attachHunks($changeset->loadHunks()); } - $properties = id(new DifferentialDiffProperty())->loadAllWhere( - 'diffID = %d', - $diff_id); - - return $this->createDiffDict($diff, $properties); + return $this->createDiffDict($diff); } - public static function createDiffDict(DifferentialDiff $diff, - array $properties) { + public static function createDiffDict(DifferentialDiff $diff) { $dict = array( 'id' => $diff->getID(), 'parent' => $diff->getParentRevisionID(), @@ -121,6 +116,9 @@ class ConduitAPI_differential_getdiff_Method extends ConduitAPIMethod { $dict['changes'][] = $change; } + $properties = id(new DifferentialDiffProperty())->loadAllWhere( + 'diffID = %d', + $diff->getID()); foreach ($properties as $property) { $dict['properties'][$property->getName()] = $property->getData(); }