mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 05:20:56 +01:00
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
This commit is contained in:
parent
27a0265367
commit
1dd91bde1f
1 changed files with 11 additions and 1 deletions
|
@ -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');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue