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

Improve error messaging for empty Conpherence threads

Summary: Fixes T7275. This makes the error stuff a little more consistent with other modern UIs.

Test Plan: {F307286}

Reviewers: chad, btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7275

Differential Revision: https://secure.phabricator.com/D11778
This commit is contained in:
epriestley 2015-02-16 11:31:00 -08:00
parent 2cd77b5b58
commit 9a9c4afe59

View file

@ -12,6 +12,7 @@ final class ConpherenceNewController extends ConpherenceController {
$message = '';
$e_participants = null;
$e_message = null;
$errors = array();
// this comes from ajax requests from all over. should be a single phid.
@ -29,10 +30,15 @@ final class ConpherenceNewController extends ConpherenceController {
foreach ($error_codes as $error_code) {
switch ($error_code) {
case ConpherenceEditor::ERROR_EMPTY_MESSAGE:
$e_message = true;
$e_message = pht('Required');
$errors[] = pht(
'You can not send an empty message.');
break;
case ConpherenceEditor::ERROR_EMPTY_PARTICIPANTS:
$e_participants = true;
$e_participants = pht('Required');
$errors[] = pht(
'You must choose at least one recipient for your '.
'message.');
break;
}
}
@ -69,6 +75,7 @@ final class ConpherenceNewController extends ConpherenceController {
$dialog = id(new AphrontDialogView())
->setWidth(AphrontDialogView::WIDTH_FORM)
->setErrors($errors)
->setUser($user)
->setTitle($title)
->addCancelButton($cancel_uri)