1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Make audit only add ccs or auditors if that was the user's intended action

Summary: this plugs this at the controller level. the editor could also be more aware of the "action" and the fix could be there.

Test Plan: set some ccs, changed it to comment, made teh comment, noted no ccs.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1838

Differential Revision: https://secure.phabricator.com/D3590
This commit is contained in:
Bob Trahan 2012-10-01 15:39:14 -07:00
parent 52770a086d
commit 6b9b1d4f95

View file

@ -44,8 +44,21 @@ final class PhabricatorAuditAddCommentController
->setAction($action) ->setAction($action)
->setContent($request->getStr('content')); ->setContent($request->getStr('content'));
$auditors = $request->getArr('auditors'); // make sure we only add auditors or ccs if the action matches
$ccs = $request->getArr('ccs'); switch ($action) {
case 'add_auditors':
$auditors = $request->getArr('auditors');
$ccs = array();
break;
case 'add_ccs':
$auditors = array();
$ccs = $request->getArr('ccs');
break;
default:
$auditors = array();
$ccs = array();
break;
}
id(new PhabricatorAuditCommentEditor($commit)) id(new PhabricatorAuditCommentEditor($commit))
->setUser($user) ->setUser($user)