From 1dd91bde1ff9b351adff72014215b0e8595552a8 Mon Sep 17 00:00:00 2001 From: Gareth Evans Date: Fri, 17 May 2013 04:13:58 -0700 Subject: [PATCH] Implement option 1 from T3210 Summary: Fixes T3210 Test Plan: Run the conduit call via the UI and ensure it no longer breaks. Check I get an error returned if no params are set Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T3210 Differential Revision: https://secure.phabricator.com/D5950 --- .../conduit/ConduitAPI_maniphest_update_Method.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/applications/maniphest/conduit/ConduitAPI_maniphest_update_Method.php b/src/applications/maniphest/conduit/ConduitAPI_maniphest_update_Method.php index 4d324b4320..a076b0f5da 100644 --- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_update_Method.php +++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_update_Method.php @@ -13,7 +13,8 @@ final class ConduitAPI_maniphest_update_Method public function defineErrorTypes() { return array( 'ERR-BAD-TASK' => 'No such maniphest task exists.', - 'ERR-INVALID-PARAMETER' => 'Missing or malformed parameter.' + 'ERR-INVALID-PARAMETER' => 'Missing or malformed parameter.', + 'ERR-NO-EFFECT' => 'Update has no effect.', ); } @@ -41,6 +42,15 @@ final class ConduitAPI_maniphest_update_Method $phid); } + $params = $request->getAllParameters(); + unset($params['id']); + unset($params['phid']); + $params = call_user_func_array('coalesce', $params); + + if (!$params) { + throw new ConduitException('ERR-NO-EFFECT'); + } + if (!$task) { throw new ConduitException('ERR-BAD-TASK'); }