@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make differential.querydiffs more liberal about arguments

Summary:
Fixes T12092. D17164 made `DiffQuery` more strict about arguments using modern conventions, but `differential.querydiffs` uses bizarre ancient conventions.

Give it more modern conventions instead.

Test Plan: Made a `querydiffs` call with only revision IDs.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12092

Differential Revision: https://secure.phabricator.com/D17172

+19 -8
+19 -8
src/applications/differential/conduit/DifferentialQueryDiffsConduitAPIMethod.php
··· 26 26 $ids = $request->getValue('ids', array()); 27 27 $revision_ids = $request->getValue('revisionIDs', array()); 28 28 29 - $diffs = array(); 30 - if ($ids || $revision_ids) { 31 - $diffs = id(new DifferentialDiffQuery()) 32 - ->setViewer($request->getUser()) 33 - ->withIDs($ids) 34 - ->withRevisionIDs($revision_ids) 35 - ->needChangesets(true) 36 - ->execute(); 29 + if (!$ids && !$revision_ids) { 30 + // This method just returns nothing if you pass no constraints because 31 + // pagination hadn't been invented yet in 2008 when this method was 32 + // written. 33 + return array(); 34 + } 35 + 36 + $query = id(new DifferentialDiffQuery()) 37 + ->setViewer($request->getUser()) 38 + ->needChangesets(true); 39 + 40 + if ($ids) { 41 + $query->withIDs($ids); 42 + } 43 + 44 + if ($revision_ids) { 45 + $query->withRevisionIDs($revision_ids); 37 46 } 47 + 48 + $diffs = $query->execute(); 38 49 39 50 return mpull($diffs, 'getDiffDict', 'getID'); 40 51 }