diff --git a/resources/celerity/map.php b/resources/celerity/map.php index d471aa939a..c1d6dc0c35 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ return array( 'names' => array( - 'core.pkg.css' => '3c41daee', + 'core.pkg.css' => '9567aaae', 'core.pkg.js' => 'c907bd96', 'darkconsole.pkg.js' => 'ca8671ce', 'differential.pkg.css' => '827749c1', @@ -23,7 +23,7 @@ return array( 'rsrc/css/aphront/context-bar.css' => '1c3b0529', 'rsrc/css/aphront/dark-console.css' => '6378ef3d', 'rsrc/css/aphront/dialog-view.css' => 'dd9db96c', - 'rsrc/css/aphront/error-view.css' => '472968e0', + 'rsrc/css/aphront/error-view.css' => 'ca515eae', 'rsrc/css/aphront/lightbox-attachment.css' => '686f8885', 'rsrc/css/aphront/list-filter-view.css' => '9577c6da', 'rsrc/css/aphront/multi-column.css' => '05bbd016', @@ -475,7 +475,7 @@ return array( 'aphront-contextbar-view-css' => '1c3b0529', 'aphront-dark-console-css' => '6378ef3d', 'aphront-dialog-view-css' => 'dd9db96c', - 'aphront-error-view-css' => '472968e0', + 'aphront-error-view-css' => 'ca515eae', 'aphront-list-filter-view-css' => '9577c6da', 'aphront-multi-column-view-css' => '05bbd016', 'aphront-notes' => '6acadd3f', diff --git a/src/applications/auth/controller/PhabricatorAuthRegisterController.php b/src/applications/auth/controller/PhabricatorAuthRegisterController.php index 62e629079b..4b2c49cee4 100644 --- a/src/applications/auth/controller/PhabricatorAuthRegisterController.php +++ b/src/applications/auth/controller/PhabricatorAuthRegisterController.php @@ -304,13 +304,6 @@ final class PhabricatorAuthRegisterController unset($unguarded); } - $error_view = null; - if ($errors) { - $error_view = new AphrontErrorView(); - $error_view->setTitle(pht('Registration Failed')); - $error_view->setErrors($errors); - } - $form = id(new AphrontFormView()) ->setUser($request->getUser()); @@ -424,7 +417,7 @@ final class PhabricatorAuthRegisterController $object_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) ->setForm($form) - ->setFormError($error_view); + ->setFormErrors($errors); return $this->buildApplicationPage( array( diff --git a/src/applications/auth/controller/config/PhabricatorAuthEditController.php b/src/applications/auth/controller/config/PhabricatorAuthEditController.php index b7a79e2209..0aa022fdd3 100644 --- a/src/applications/auth/controller/config/PhabricatorAuthEditController.php +++ b/src/applications/auth/controller/config/PhabricatorAuthEditController.php @@ -153,10 +153,6 @@ final class PhabricatorAuthEditController $issues = array(); } - if ($errors) { - $errors = id(new AphrontErrorView())->setErrors($errors); - } - if ($is_new) { $button = pht('Add Provider'); $crumb = pht('Add Provider'); @@ -302,7 +298,7 @@ final class PhabricatorAuthEditController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($errors) + ->setFormErrors($errors) ->setForm($form); return $this->buildApplicationPage( diff --git a/src/applications/auth/controller/config/PhabricatorAuthNewController.php b/src/applications/auth/controller/config/PhabricatorAuthNewController.php index 3362f01357..4e3051ca93 100644 --- a/src/applications/auth/controller/config/PhabricatorAuthNewController.php +++ b/src/applications/auth/controller/config/PhabricatorAuthNewController.php @@ -37,10 +37,6 @@ final class PhabricatorAuthNewController } } - if ($errors) { - $errors = id(new AphrontErrorView())->setErrors($errors); - } - $options = id(new AphrontFormRadioButtonControl()) ->setLabel(pht('Provider')) ->setName('provider') @@ -83,7 +79,7 @@ final class PhabricatorAuthNewController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Add Authentication Provider')) - ->setFormError($errors) + ->setFormErrors($errors) ->setForm($form); $crumbs = $this->buildApplicationCrumbs(); diff --git a/src/applications/calendar/controller/PhabricatorCalendarEditStatusController.php b/src/applications/calendar/controller/PhabricatorCalendarEditStatusController.php index 1d4ced5015..47be7d376e 100644 --- a/src/applications/calendar/controller/PhabricatorCalendarEditStatusController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarEditStatusController.php @@ -165,7 +165,7 @@ final class PhabricatorCalendarEditStatusController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($page_title) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); $nav = $this->buildSideNavView($status); diff --git a/src/applications/conduit/controller/PhabricatorConduitConsoleController.php b/src/applications/conduit/controller/PhabricatorConduitConsoleController.php index 82a41de59b..e1b5da5ed0 100644 --- a/src/applications/conduit/controller/PhabricatorConduitConsoleController.php +++ b/src/applications/conduit/controller/PhabricatorConduitConsoleController.php @@ -112,7 +112,7 @@ final class PhabricatorConduitConsoleController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($method->getAPIMethodName()) - ->setFormError($status_view) + ->setErrorView($status_view) ->setForm($form); $crumbs = $this->buildApplicationCrumbs(); diff --git a/src/applications/config/controller/PhabricatorConfigEditController.php b/src/applications/config/controller/PhabricatorConfigEditController.php index 42bc8bfe59..af9ceda313 100644 --- a/src/applications/config/controller/PhabricatorConfigEditController.php +++ b/src/applications/config/controller/PhabricatorConfigEditController.php @@ -195,9 +195,12 @@ final class PhabricatorConfigEditController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($error_view) ->setForm($form); + if ($error_view) { + $form_box->setErrorView($error_view); + } + $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb(pht('Config'), $this->getApplicationURI()); diff --git a/src/applications/countdown/controller/PhabricatorCountdownEditController.php b/src/applications/countdown/controller/PhabricatorCountdownEditController.php index b993f490dd..e8443645be 100644 --- a/src/applications/countdown/controller/PhabricatorCountdownEditController.php +++ b/src/applications/countdown/controller/PhabricatorCountdownEditController.php @@ -35,7 +35,6 @@ final class PhabricatorCountdownEditController $countdown = PhabricatorCountdown::initializeNewCountdown($user); } - $error_view = null; $e_text = true; $e_epoch = null; @@ -71,11 +70,6 @@ final class PhabricatorCountdownEditController $countdown->save(); return id(new AphrontRedirectResponse()) ->setURI('/countdown/'.$countdown->getID().'/'); - } else { - $error_view = id(new AphrontErrorView()) - ->setErrors($errors) - ->setTitle(pht('It\'s not The Final Countdown (du nu nuuu nun)' . - ' until you fix these problem')); } } @@ -135,7 +129,7 @@ final class PhabricatorCountdownEditController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($page_title) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); return $this->buildApplicationPage( diff --git a/src/applications/differential/controller/DifferentialDiffCreateController.php b/src/applications/differential/controller/DifferentialDiffCreateController.php index f86564f908..eb972cc14f 100644 --- a/src/applications/differential/controller/DifferentialDiffCreateController.php +++ b/src/applications/differential/controller/DifferentialDiffCreateController.php @@ -84,14 +84,8 @@ final class DifferentialDiffCreateController extends DifferentialController { $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Create New Diff')) - ->setForm($form); - - if ($errors) { - $error_view = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_ERROR) - ->appendChild($errors); - $form_box->setFormError($error_view); - } + ->setForm($form) + ->setFormErrors($errors); $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb(pht('Create Diff')); diff --git a/src/applications/differential/controller/DifferentialRevisionEditController.php b/src/applications/differential/controller/DifferentialRevisionEditController.php index e58c88038e..a070dea9c9 100644 --- a/src/applications/differential/controller/DifferentialRevisionEditController.php +++ b/src/applications/differential/controller/DifferentialRevisionEditController.php @@ -108,13 +108,6 @@ final class DifferentialRevisionEditController extends DifferentialController { $form->setAction('/differential/revision/edit/'); } - $error_view = null; - if ($errors) { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Form Errors')) - ->setErrors($errors); - } - if ($diff && $revision->getID()) { $form ->appendChild( @@ -168,7 +161,7 @@ final class DifferentialRevisionEditController extends DifferentialController { $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); $crumbs->addTextCrumb($title); diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php index 8f510455d2..531b2a0c57 100644 --- a/src/applications/diffusion/controller/DiffusionCommitController.php +++ b/src/applications/diffusion/controller/DiffusionCommitController.php @@ -269,7 +269,7 @@ final class DiffusionCommitController extends DiffusionController { ->appendChild( pht("This commit is very large. Load each file individually.")); - $change_panel->setFormError($warning_view); + $change_panel->setErrorView($warning_view); $header->addActionLink($button); } diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php index f946b4dcdd..c7f80987f0 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php @@ -83,14 +83,6 @@ final class DiffusionRepositoryEditBasicController $crumbs->addTextCrumb(pht('Edit Basics')); $title = pht('Edit %s', $repository->getName()); - - $error_view = null; - if ($errors) { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Form Errors')) - ->setErrors($errors); - } - $project_handles = $this->loadViewerHandles($repository->getProjectPHIDs()); $form = id(new AphrontFormView()) @@ -122,7 +114,7 @@ final class DiffusionRepositoryEditBasicController $object_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) ->setForm($form) - ->setFormError($error_view); + ->setFormErrors($errors); return $this->buildApplicationPage( array( diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php index eebc6d193f..55fa5f1420 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php @@ -61,13 +61,6 @@ final class DiffusionRepositoryEditEncodingController $title = pht('Edit %s', $repository->getName()); - $error_view = null; - if ($errors) { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Form Errors')) - ->setErrors($errors); - } - $form = id(new AphrontFormView()) ->setUser($user) ->appendRemarkupInstructions($this->getEncodingInstructions()) @@ -85,7 +78,7 @@ final class DiffusionRepositoryEditEncodingController $object_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) ->setForm($form) - ->setFormError($error_view); + ->setFormErrors($errors); return $this->buildApplicationPage( array( diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditLocalController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditLocalController.php index 34e66e21b0..79519c788a 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditLocalController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditLocalController.php @@ -33,13 +33,6 @@ final class DiffusionRepositoryEditLocalController $title = pht('Edit %s', $repository->getName()); - $error_view = null; - if ($errors) { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Form Errors')) - ->setErrors($errors); - } - $form = id(new AphrontFormView()) ->setUser($user) ->appendRemarkupInstructions( @@ -61,7 +54,7 @@ final class DiffusionRepositoryEditLocalController $object_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) ->setForm($form) - ->setFormError($error_view); + ->setFormErrors($errors); return $this->buildApplicationPage( array( diff --git a/src/applications/diffusion/panel/DiffusionSetPasswordPanel.php b/src/applications/diffusion/panel/DiffusionSetPasswordPanel.php index ece9468e40..22ebea500c 100644 --- a/src/applications/diffusion/panel/DiffusionSetPasswordPanel.php +++ b/src/applications/diffusion/panel/DiffusionSetPasswordPanel.php @@ -86,13 +86,6 @@ final class DiffusionSetPasswordPanel extends PhabricatorSettingsPanel { $title = pht('Set VCS Password'); - $error_view = null; - if ($errors) { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Form Errors')) - ->setErrors($errors); - } - $form = id(new AphrontFormView()) ->setUser($user) ->appendRemarkupInstructions( @@ -165,7 +158,7 @@ final class DiffusionSetPasswordPanel extends PhabricatorSettingsPanel { $object_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) ->setForm($form) - ->setFormError($error_view); + ->setFormErrors($errors); $remove_form = id(new AphrontFormView()) ->setUser($user); diff --git a/src/applications/drydock/controller/DrydockBlueprintCreateController.php b/src/applications/drydock/controller/DrydockBlueprintCreateController.php index ef71f218d3..664ef2d2dc 100644 --- a/src/applications/drydock/controller/DrydockBlueprintCreateController.php +++ b/src/applications/drydock/controller/DrydockBlueprintCreateController.php @@ -29,12 +29,6 @@ final class DrydockBlueprintCreateController } } - $error_view = null; - if ($errors) { - $error_view = id(new AphrontErrorView()) - ->setErrors($errors); - } - $control = id(new AphrontFormRadioButtonControl()) ->setName('blueprint-type') ->setLabel(pht('Blueprint Type')) @@ -69,7 +63,7 @@ final class DrydockBlueprintCreateController ->setValue(pht('Continue'))); $box = id(new PHUIObjectBoxView()) - ->setFormError($error_view) + ->setFormErrors($errors) ->setHeaderText($title) ->setForm($form); diff --git a/src/applications/drydock/controller/DrydockBlueprintEditController.php b/src/applications/drydock/controller/DrydockBlueprintEditController.php index 8ab80d679c..f10359e519 100644 --- a/src/applications/drydock/controller/DrydockBlueprintEditController.php +++ b/src/applications/drydock/controller/DrydockBlueprintEditController.php @@ -86,11 +86,6 @@ final class DrydockBlueprintEditController extends DrydockBlueprintController { } } - $error_view = null; - if ($errors) { - $error_view = id(new AphrontErrorView())->setErrors($errors); - } - $policies = id(new PhabricatorPolicyQuery()) ->setViewer($viewer) ->setObject($blueprint) @@ -144,7 +139,7 @@ final class DrydockBlueprintEditController extends DrydockBlueprintController { $box = id(new PHUIObjectBoxView()) ->setHeaderText($header) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); return $this->buildApplicationPage( diff --git a/src/applications/files/controller/PhabricatorFileUploadController.php b/src/applications/files/controller/PhabricatorFileUploadController.php index 22d5846e4c..4f3d19d9e1 100644 --- a/src/applications/files/controller/PhabricatorFileUploadController.php +++ b/src/applications/files/controller/PhabricatorFileUploadController.php @@ -64,18 +64,12 @@ final class PhabricatorFileUploadController extends PhabricatorFileController { $title = pht('Upload File'); - if ($errors) { - $errors = id(new AphrontErrorView()) - ->setTitle(pht('Form Errors')) - ->setErrors($errors); - } - $global_upload = id(new PhabricatorGlobalUploadTargetView()) ->setShowIfSupportedID($support_id); $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($errors) + ->setFormErrors($errors) ->setForm($form); return $this->buildApplicationPage( diff --git a/src/applications/herald/controller/HeraldNewController.php b/src/applications/herald/controller/HeraldNewController.php index 94d19d3765..c207c41b82 100644 --- a/src/applications/herald/controller/HeraldNewController.php +++ b/src/applications/herald/controller/HeraldNewController.php @@ -98,10 +98,6 @@ final class HeraldNewController extends HeraldController { $content_type = $request->getStr('content_type'); $rule_type = $request->getStr('rule_type'); - if ($errors) { - $errors = id(new AphrontErrorView())->setErrors($errors); - } - $form = id(new AphrontFormView()) ->setUser($viewer) ->setAction($this->getApplicationURI('new/')); @@ -203,7 +199,7 @@ final class HeraldNewController extends HeraldController { ->addCancelButton($cancel_uri, $cancel_text)); $form_box = id(new PHUIObjectBoxView()) - ->setFormError($errors) + ->setFormErrors($errors) ->setHeaderText(pht('Create Herald Rule')) ->setForm($form); diff --git a/src/applications/herald/controller/HeraldRuleController.php b/src/applications/herald/controller/HeraldRuleController.php index a5f11edfdb..36a904038a 100644 --- a/src/applications/herald/controller/HeraldRuleController.php +++ b/src/applications/herald/controller/HeraldRuleController.php @@ -118,14 +118,6 @@ final class HeraldRuleController extends HeraldController { } } - if ($errors) { - $error_view = new AphrontErrorView(); - $error_view->setTitle(pht('Form Errors')); - $error_view->setErrors($errors); - } else { - $error_view = null; - } - $must_match_selector = $this->renderMustMatchSelector($rule); $repetition_selector = $this->renderRepetitionSelector($rule, $adapter); @@ -233,7 +225,7 @@ final class HeraldRuleController extends HeraldController { $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); $crumbs = $this diff --git a/src/applications/herald/controller/HeraldTestConsoleController.php b/src/applications/herald/controller/HeraldTestConsoleController.php index fb2f1cc996..c2e1cfb781 100644 --- a/src/applications/herald/controller/HeraldTestConsoleController.php +++ b/src/applications/herald/controller/HeraldTestConsoleController.php @@ -74,14 +74,6 @@ final class HeraldTestConsoleController extends HeraldController { } } - if ($errors) { - $error_view = new AphrontErrorView(); - $error_view->setTitle(pht('Form Errors')); - $error_view->setErrors($errors); - } else { - $error_view = null; - } - $text = pht( 'Enter an object to test rules for, like a Diffusion commit (e.g., '. 'rX123) or a Differential revision (e.g., D123). You will be shown '. @@ -103,7 +95,7 @@ final class HeraldTestConsoleController extends HeraldController { $box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Herald Test Console')) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); $crumbs = id($this->buildApplicationCrumbs()) diff --git a/src/applications/legalpad/controller/LegalpadDocumentEditController.php b/src/applications/legalpad/controller/LegalpadDocumentEditController.php index ec27cb1965..dd5879dfe5 100644 --- a/src/applications/legalpad/controller/LegalpadDocumentEditController.php +++ b/src/applications/legalpad/controller/LegalpadDocumentEditController.php @@ -102,11 +102,7 @@ final class LegalpadDocumentEditController extends LegalpadController { } } - $error_view = null; if ($errors) { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('A Fatal Omission!')) - ->setErrors($errors); // set these to what was specified in the form on post $document->setViewPolicy($can_view); $document->setEditPolicy($can_edit); @@ -169,7 +165,7 @@ final class LegalpadDocumentEditController extends LegalpadController { $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); $crumbs = $this->buildApplicationCrumbs($this->buildSideNav()); diff --git a/src/applications/legalpad/controller/LegalpadDocumentSignController.php b/src/applications/legalpad/controller/LegalpadDocumentSignController.php index ea6d3ac07a..c5aa327b1f 100644 --- a/src/applications/legalpad/controller/LegalpadDocumentSignController.php +++ b/src/applications/legalpad/controller/LegalpadDocumentSignController.php @@ -220,7 +220,7 @@ final class LegalpadDocumentSignController extends LegalpadController { return id(new PHUIObjectBoxView()) ->setHeaderText(pht('Sign and Agree')) - ->setFormError($error_view) + ->setErrorView($error_view) ->setForm($form); } diff --git a/src/applications/macro/controller/PhabricatorMacroAudioController.php b/src/applications/macro/controller/PhabricatorMacroAudioController.php index 1332163c55..287e7f9f03 100644 --- a/src/applications/macro/controller/PhabricatorMacroAudioController.php +++ b/src/applications/macro/controller/PhabricatorMacroAudioController.php @@ -82,14 +82,6 @@ final class PhabricatorMacroAudioController } } - if ($errors) { - $error_view = new AphrontErrorView(); - $error_view->setTitle(pht('Form Errors')); - $error_view->setErrors($errors); - } else { - $error_view = null; - } - $form = id(new AphrontFormView()) ->addHiddenInput('behaviorForm', 1) ->setUser($viewer); @@ -152,7 +144,7 @@ final class PhabricatorMacroAudioController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); return $this->buildApplicationPage( diff --git a/src/applications/macro/controller/PhabricatorMacroEditController.php b/src/applications/macro/controller/PhabricatorMacroEditController.php index 99c7acc112..667170def8 100644 --- a/src/applications/macro/controller/PhabricatorMacroEditController.php +++ b/src/applications/macro/controller/PhabricatorMacroEditController.php @@ -135,14 +135,6 @@ final class PhabricatorMacroEditController } } - if ($errors) { - $error_view = new AphrontErrorView(); - $error_view->setTitle(pht('Form Errors')); - $error_view->setErrors($errors); - } else { - $error_view = null; - } - $current_file = null; if ($macro->getFilePHID()) { $current_file = $macro->getFile(); @@ -257,7 +249,7 @@ final class PhabricatorMacroEditController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); return $this->buildApplicationPage( diff --git a/src/applications/mailinglists/controller/PhabricatorMailingListsEditController.php b/src/applications/mailinglists/controller/PhabricatorMailingListsEditController.php index aeca4bfeac..ccf6e42e18 100644 --- a/src/applications/mailinglists/controller/PhabricatorMailingListsEditController.php +++ b/src/applications/mailinglists/controller/PhabricatorMailingListsEditController.php @@ -74,13 +74,6 @@ final class PhabricatorMailingListsEditController } } - $error_view = null; - if ($errors) { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Form Errors')) - ->setErrors($errors); - } - $form = new AphrontFormView(); $form->setUser($request->getUser()); if ($list->getID()) { @@ -124,7 +117,7 @@ final class PhabricatorMailingListsEditController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($page_title) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); return $this->buildApplicationPage( diff --git a/src/applications/maniphest/controller/ManiphestTaskEditController.php b/src/applications/maniphest/controller/ManiphestTaskEditController.php index 0d6e84d72d..393a713b60 100644 --- a/src/applications/maniphest/controller/ManiphestTaskEditController.php +++ b/src/applications/maniphest/controller/ManiphestTaskEditController.php @@ -419,7 +419,6 @@ final class ManiphestTaskEditController extends ManiphestController { if ($errors) { $error_view = new AphrontErrorView(); $error_view->setErrors($errors); - $error_view->setTitle(pht('Form Errors')); } $priority_map = ManiphestTaskPriority::getTaskPriorityMap(); @@ -650,7 +649,7 @@ final class ManiphestTaskEditController extends ManiphestController { $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($header_name) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); $preview = id(new PHUIRemarkupPreviewPanel()) diff --git a/src/applications/nuance/source/NuanceSourceDefinition.php b/src/applications/nuance/source/NuanceSourceDefinition.php index 8bdc63d958..86eea6ddeb 100644 --- a/src/applications/nuance/source/NuanceSourceDefinition.php +++ b/src/applications/nuance/source/NuanceSourceDefinition.php @@ -164,10 +164,8 @@ abstract class NuanceSourceDefinition extends Phobject { $layout = id(new PHUIObjectBoxView()) ->setHeaderText($this->getEditTitle()) ->setValidationException($validation_exception) + ->setFormErrors($error_messages) ->setForm($form); - if ($error_messages) { - $layout->setFormError($this->renderEditErrorView($error_messages)); - } return $layout; } @@ -237,15 +235,6 @@ abstract class NuanceSourceDefinition extends Phobject { return $form; } - /** - * return @{class:AphrontErrorView} - */ - public function renderEditErrorView(array $errors) { - return id(new AphrontErrorView()) - ->setTitle(pht('Error with submission.')) - ->setErrors($errors); - } - /** * Hook to build up @{class:PhabricatorTransactions}. * diff --git a/src/applications/owners/controller/PhabricatorOwnersEditController.php b/src/applications/owners/controller/PhabricatorOwnersEditController.php index 77c3f582b5..b456e3f729 100644 --- a/src/applications/owners/controller/PhabricatorOwnersEditController.php +++ b/src/applications/owners/controller/PhabricatorOwnersEditController.php @@ -112,13 +112,6 @@ final class PhabricatorOwnersEditController } } - $error_view = null; - if ($errors) { - $error_view = new AphrontErrorView(); - $error_view->setTitle(pht('Package Errors')); - $error_view->setErrors($errors); - } - $handles = $this->loadViewerHandles($owners); $primary = $package->getPrimaryOwnerPHID(); @@ -252,7 +245,7 @@ final class PhabricatorOwnersEditController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); $nav = $this->buildSideNavView(); diff --git a/src/applications/passphrase/controller/PassphraseCredentialCreateController.php b/src/applications/passphrase/controller/PassphraseCredentialCreateController.php index d311dc9d0b..ab2820b668 100644 --- a/src/applications/passphrase/controller/PassphraseCredentialCreateController.php +++ b/src/applications/passphrase/controller/PassphraseCredentialCreateController.php @@ -26,12 +26,6 @@ final class PassphraseCredentialCreateController extends PassphraseController { } } - $error_view = null; - if ($errors) { - $error_view = id(new AphrontErrorView()) - ->setErrors($errors); - } - $types_control = id(new AphrontFormRadioButtonControl()) ->setName('type') ->setLabel(pht('Credential Type')) @@ -59,7 +53,7 @@ final class PassphraseCredentialCreateController extends PassphraseController { $box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Create New Credential')) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); return $this->buildApplicationPage( diff --git a/src/applications/paste/controller/PhabricatorPasteEditController.php b/src/applications/paste/controller/PhabricatorPasteEditController.php index e83cf66560..394d62eae1 100644 --- a/src/applications/paste/controller/PhabricatorPasteEditController.php +++ b/src/applications/paste/controller/PhabricatorPasteEditController.php @@ -123,13 +123,6 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController { } } - $error_view = null; - if ($errors) { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('A Fatal Omission!')) - ->setErrors($errors); - } - $form = new AphrontFormView(); $langs = array( @@ -207,7 +200,7 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController { $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); $crumbs = $this->buildApplicationCrumbs($this->buildSideNavView()); diff --git a/src/applications/people/controller/PhabricatorPeopleEditController.php b/src/applications/people/controller/PhabricatorPeopleEditController.php index 1638f023f5..7f72f0f834 100644 --- a/src/applications/people/controller/PhabricatorPeopleEditController.php +++ b/src/applications/people/controller/PhabricatorPeopleEditController.php @@ -214,13 +214,6 @@ final class PhabricatorPeopleEditController } } - $error_view = null; - if ($errors) { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Form Errors')) - ->setErrors($errors); - } - $form = new AphrontFormView(); $form->setUser($admin); if ($user->getID()) { @@ -347,7 +340,7 @@ final class PhabricatorPeopleEditController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); return array($form_box); @@ -396,14 +389,6 @@ final class PhabricatorPeopleEditController } } - $error_view = null; - if ($errors) { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Form Errors')) - ->setErrors($errors); - } - - $form = id(new AphrontFormView()) ->setUser($admin) ->setAction($request->getRequestURI()->alter('saved', null)); @@ -452,7 +437,7 @@ final class PhabricatorPeopleEditController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); return array($form_box); @@ -537,14 +522,6 @@ final class PhabricatorPeopleEditController } } - if ($errors) { - $errors = id(new AphrontErrorView()) - ->setTitle(pht('Form Errors')) - ->setErrors($errors); - } else { - $errors = null; - } - $inst1 = pht('Be careful when renaming users!'); $inst2 = pht('The old username will no longer be tied to the user, so '. 'anything which uses it (like old commit messages) will no longer '. @@ -590,7 +567,7 @@ final class PhabricatorPeopleEditController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Change Username')) - ->setFormError($errors) + ->setFormErrors($errors) ->setForm($form); return array($form_box); @@ -636,14 +613,6 @@ final class PhabricatorPeopleEditController } } - if ($errors) { - $errors = id(new AphrontErrorView()) - ->setTitle(pht('Form Errors')) - ->setErrors($errors); - } else { - $errors = null; - } - $str1 = pht('Be careful when deleting users!'); $str2 = pht('If this user interacted with anything, it is generally '. 'better to disable them, not delete them. If you delete them, it will '. @@ -683,7 +652,7 @@ final class PhabricatorPeopleEditController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Delete User')) - ->setFormError($errors) + ->setFormErrors($errors) ->setForm($form); return array($form_box); diff --git a/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php b/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php index 91405ea4a7..07e12639f0 100644 --- a/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php +++ b/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php @@ -258,7 +258,7 @@ final class PhabricatorPeopleProfilePictureController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($errors) + ->setFormErrors($errors) ->setForm($form); $upload_form = id(new AphrontFormView()) @@ -276,15 +276,6 @@ final class PhabricatorPeopleProfilePictureController ->addCancelButton($profile_uri) ->setValue(pht('Upload Picture'))); - if ($errors) { - $errors = id(new AphrontErrorView())->setErrors($errors); - } - - $form_box = id(new PHUIObjectBoxView()) - ->setHeaderText($title) - ->setFormError($errors) - ->setForm($form); - $upload_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Upload New Picture')) ->setForm($upload_form); diff --git a/src/applications/phame/controller/blog/PhameBlogEditController.php b/src/applications/phame/controller/blog/PhameBlogEditController.php index be2ae64a85..b8d4f87ccd 100644 --- a/src/applications/phame/controller/blog/PhameBlogEditController.php +++ b/src/applications/phame/controller/blog/PhameBlogEditController.php @@ -162,17 +162,9 @@ final class PhameBlogEditController ->addCancelButton($cancel_uri) ->setValue($submit_button)); - if ($errors) { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Form Errors')) - ->setErrors($errors); - } else { - $error_view = null; - } - $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($page_title) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); $crumbs = $this->buildApplicationCrumbs(); diff --git a/src/applications/phame/controller/post/PhamePostEditController.php b/src/applications/phame/controller/post/PhamePostEditController.php index 2dfc479bcd..37356b80b3 100644 --- a/src/applications/phame/controller/post/PhamePostEditController.php +++ b/src/applications/phame/controller/post/PhamePostEditController.php @@ -163,17 +163,9 @@ final class PhamePostEditController 'uri' => '/phame/post/preview/', )); - if ($errors) { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Errors saving post.')) - ->setErrors($errors); - } else { - $error_view = null; - } - $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($page_title) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); $crumbs = $this->buildApplicationCrumbs(); diff --git a/src/applications/phlux/controller/PhluxEditController.php b/src/applications/phlux/controller/PhluxEditController.php index bf162169ba..45347ede9a 100644 --- a/src/applications/phlux/controller/PhluxEditController.php +++ b/src/applications/phlux/controller/PhluxEditController.php @@ -109,11 +109,6 @@ final class PhluxEditController extends PhluxController { } } - if ($errors) { - $errors = id(new AphrontErrorView()) - ->setErrors($errors); - } - $policies = id(new PhabricatorPolicyQuery()) ->setViewer($user) ->setObject($var) @@ -172,7 +167,7 @@ final class PhluxEditController extends PhluxController { $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($errors) + ->setFormErrors($errors) ->setForm($form); return $this->buildApplicationPage( diff --git a/src/applications/pholio/controller/PholioMockEditController.php b/src/applications/pholio/controller/PholioMockEditController.php index 0980a7493d..1cbb6fcbb4 100644 --- a/src/applications/pholio/controller/PholioMockEditController.php +++ b/src/applications/pholio/controller/PholioMockEditController.php @@ -199,14 +199,6 @@ final class PholioMockEditController extends PholioController { } } - if ($errors) { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Form Errors')) - ->setErrors($errors); - } else { - $error_view = null; - } - if ($this->id) { $submit = id(new AphrontFormSubmitControl()) ->addCancelButton('/M'.$this->id) @@ -322,7 +314,7 @@ final class PholioMockEditController extends PholioController { $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); $crumbs = $this->buildApplicationCrumbs(); diff --git a/src/applications/phragment/controller/PhragmentSnapshotCreateController.php b/src/applications/phragment/controller/PhragmentSnapshotCreateController.php index 48018cc573..a689b9951b 100644 --- a/src/applications/phragment/controller/PhragmentSnapshotCreateController.php +++ b/src/applications/phragment/controller/PhragmentSnapshotCreateController.php @@ -32,10 +32,8 @@ final class PhragmentSnapshotCreateController extends PhragmentController { ->withLeadingPath($fragment->getPath().'/') ->execute(); - $error_view = null; - + $errors = array(); if ($request->isFormPost()) { - $errors = array(); $v_name = $request->getStr('name'); if (strlen($v_name) === 0) { @@ -79,10 +77,6 @@ final class PhragmentSnapshotCreateController extends PhragmentController { ->setURI('/phragment/snapshot/view/'.$snapshot->getID()); } } - - $error_view = id(new AphrontErrorView()) - ->setErrors($errors) - ->setTitle(pht('Errors while creating snapshot')); } $fragment_sequence = "-"; @@ -158,7 +152,7 @@ final class PhragmentSnapshotCreateController extends PhragmentController { $box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Create Snapshot of %s', $fragment->getName())) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); return $this->buildApplicationPage( diff --git a/src/applications/phriction/controller/PhrictionEditController.php b/src/applications/phriction/controller/PhrictionEditController.php index 63f184dde9..e9df079fdb 100644 --- a/src/applications/phriction/controller/PhrictionEditController.php +++ b/src/applications/phriction/controller/PhrictionEditController.php @@ -149,13 +149,6 @@ final class PhrictionEditController } } - $error_view = null; - if ($errors) { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Form Errors')) - ->setErrors($errors); - } - if ($document->getID()) { $panel_header = pht('Edit Phriction Document'); $submit_button = pht('Save Changes'); @@ -230,7 +223,7 @@ final class PhrictionEditController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Edit Document')) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); $preview = id(new PHUIRemarkupPreviewPanel()) diff --git a/src/applications/phriction/controller/PhrictionMoveController.php b/src/applications/phriction/controller/PhrictionMoveController.php index b870c48d33..39ebe028d7 100644 --- a/src/applications/phriction/controller/PhrictionMoveController.php +++ b/src/applications/phriction/controller/PhrictionMoveController.php @@ -111,7 +111,6 @@ final class PhrictionMoveController if ($errors) { $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Form Errors')) ->setErrors($errors); } diff --git a/src/applications/ponder/controller/PonderAnswerEditController.php b/src/applications/ponder/controller/PonderAnswerEditController.php index 4ef6f6fb56..ac045149a3 100644 --- a/src/applications/ponder/controller/PonderAnswerEditController.php +++ b/src/applications/ponder/controller/PonderAnswerEditController.php @@ -61,10 +61,6 @@ final class PonderAnswerEditController extends PonderController { } } - if ($errors) { - $errors = id(new AphrontErrorView())->setErrors($errors); - } - $answer_content_id = celerity_generate_unique_node_id(); $form = id(new AphrontFormView()) @@ -91,7 +87,7 @@ final class PonderAnswerEditController extends PonderController { $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Edit Answer')) - ->setFormError($errors) + ->setFormErrors($errors) ->setForm($form); $preview = id(new PHUIRemarkupPreviewPanel()) diff --git a/src/applications/ponder/controller/PonderQuestionEditController.php b/src/applications/ponder/controller/PonderQuestionEditController.php index cfaa9a0a09..42cf045718 100644 --- a/src/applications/ponder/controller/PonderQuestionEditController.php +++ b/src/applications/ponder/controller/PonderQuestionEditController.php @@ -76,13 +76,6 @@ final class PonderQuestionEditController extends PonderController { } } - $error_view = null; - if ($errors) { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Form Errors')) - ->setErrors($errors); - } - $form = id(new AphrontFormView()) ->setUser($user) ->appendChild( @@ -110,7 +103,7 @@ final class PonderQuestionEditController extends PonderController { $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Ask New Question')) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); $crumbs = $this->buildApplicationCrumbs(); diff --git a/src/applications/project/controller/PhabricatorProjectBoardEditController.php b/src/applications/project/controller/PhabricatorProjectBoardEditController.php index 1bf82d5a83..703f22654d 100644 --- a/src/applications/project/controller/PhabricatorProjectBoardEditController.php +++ b/src/applications/project/controller/PhabricatorProjectBoardEditController.php @@ -63,11 +63,6 @@ final class PhabricatorProjectBoardEditController return id(new AphrontRedirectResponse())->setURI($view_uri); } } - if ($errors) { - $error_view = new AphrontErrorView(); - $error_view->setTitle(pht('Form Errors')); - $error_view->setErrors($errors); - } $form = new AphrontFormView(); $form->setUser($request->getUser()) @@ -98,7 +93,7 @@ final class PhabricatorProjectBoardEditController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($errors) + ->setFormErrors($errors) ->setForm($form); return $this->buildApplicationPage( diff --git a/src/applications/project/controller/PhabricatorProjectCreateController.php b/src/applications/project/controller/PhabricatorProjectCreateController.php index cdcfdb283b..0a1240f746 100644 --- a/src/applications/project/controller/PhabricatorProjectCreateController.php +++ b/src/applications/project/controller/PhabricatorProjectCreateController.php @@ -67,7 +67,6 @@ final class PhabricatorProjectCreateController $error_view = null; if ($errors) { $error_view = new AphrontErrorView(); - $error_view->setTitle(pht('Form Errors')); $error_view->setErrors($errors); } @@ -118,7 +117,7 @@ final class PhabricatorProjectCreateController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Create New Project')) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); return $this->buildApplicationPage( diff --git a/src/applications/project/controller/PhabricatorProjectProfileEditController.php b/src/applications/project/controller/PhabricatorProjectProfileEditController.php index db39cc1598..57c2857047 100644 --- a/src/applications/project/controller/PhabricatorProjectProfileEditController.php +++ b/src/applications/project/controller/PhabricatorProjectProfileEditController.php @@ -93,13 +93,6 @@ final class PhabricatorProjectProfileEditController } } - $error_view = null; - if ($errors) { - $error_view = new AphrontErrorView(); - $error_view->setTitle(pht('Form Errors')); - $error_view->setErrors($errors); - } - $header_name = pht('Edit Project'); $title = pht('Edit Project'); $action = '/project/edit/'.$project->getID().'/'; @@ -162,7 +155,7 @@ final class PhabricatorProjectProfileEditController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); $crumbs = $this->buildApplicationCrumbs($this->buildSideNavView()) diff --git a/src/applications/project/controller/PhabricatorProjectProfilePictureController.php b/src/applications/project/controller/PhabricatorProjectProfilePictureController.php index 41f02eebbd..8c2145f9f4 100644 --- a/src/applications/project/controller/PhabricatorProjectProfilePictureController.php +++ b/src/applications/project/controller/PhabricatorProjectProfilePictureController.php @@ -222,11 +222,6 @@ final class PhabricatorProjectProfilePictureController ->setLabel(pht('Quick Create')) ->setValue($compose_form)); - $form_box = id(new PHUIObjectBoxView()) - ->setHeaderText($title) - ->setFormError($errors) - ->setForm($form); - $upload_form = id(new AphrontFormView()) ->setUser($viewer) ->setEncType('multipart/form-data') @@ -242,13 +237,9 @@ final class PhabricatorProjectProfilePictureController ->addCancelButton($project_uri) ->setValue(pht('Upload Picture'))); - if ($errors) { - $errors = id(new AphrontErrorView())->setErrors($errors); - } - $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($errors) + ->setFormErrors($errors) ->setForm($form); $upload_box = id(new PHUIObjectBoxView()) diff --git a/src/applications/releeph/controller/branch/ReleephBranchCreateController.php b/src/applications/releeph/controller/branch/ReleephBranchCreateController.php index 3978571c47..cf21e44461 100644 --- a/src/applications/releeph/controller/branch/ReleephBranchCreateController.php +++ b/src/applications/releeph/controller/branch/ReleephBranchCreateController.php @@ -68,7 +68,6 @@ final class ReleephBranchCreateController extends ReleephProjectController { if ($errors) { $error_view = new AphrontErrorView(); $error_view->setErrors($errors); - $error_view->setTitle(pht('Form Errors')); } $project_id = $releeph_project->getID(); diff --git a/src/applications/releeph/controller/project/ReleephProjectCreateController.php b/src/applications/releeph/controller/project/ReleephProjectCreateController.php index 2195a4d51e..d5c8ef20e9 100644 --- a/src/applications/releeph/controller/project/ReleephProjectCreateController.php +++ b/src/applications/releeph/controller/project/ReleephProjectCreateController.php @@ -52,12 +52,6 @@ final class ReleephProjectCreateController extends ReleephProjectController { } } - $error_view = null; - if ($errors) { - $error_view = new AphrontErrorView(); - $error_view->setErrors($errors); - } - $arc_project_options = $this->getArcProjectSelectOptions($arc_projects); $project_name_input = id(new AphrontFormTextControl()) @@ -110,7 +104,7 @@ final class ReleephProjectCreateController extends ReleephProjectController { $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Create New Project')) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); $crumbs = $this->buildApplicationCrumbs(); diff --git a/src/applications/releeph/controller/project/ReleephProjectEditController.php b/src/applications/releeph/controller/project/ReleephProjectEditController.php index 47a42f46ea..1f10d94b32 100644 --- a/src/applications/releeph/controller/project/ReleephProjectEditController.php +++ b/src/applications/releeph/controller/project/ReleephProjectEditController.php @@ -116,7 +116,6 @@ final class ReleephProjectEditController extends ReleephProjectController { if ($errors) { $error_view = new AphrontErrorView(); $error_view->setErrors($errors); - $error_view->setTitle(pht('Form Errors')); } $projects = mpull( diff --git a/src/applications/releeph/controller/request/ReleephRequestEditController.php b/src/applications/releeph/controller/request/ReleephRequestEditController.php index dc9d8abab9..f39085893f 100644 --- a/src/applications/releeph/controller/request/ReleephRequestEditController.php +++ b/src/applications/releeph/controller/request/ReleephRequestEditController.php @@ -204,7 +204,6 @@ final class ReleephRequestEditController extends ReleephProjectController { if ($errors) { $error_view = new AphrontErrorView(); $error_view->setErrors($errors); - $error_view->setTitle('Form Errors'); } $form = id(new AphrontFormView()) diff --git a/src/applications/search/controller/PhabricatorSearchEditController.php b/src/applications/search/controller/PhabricatorSearchEditController.php index f85f94f76d..8c18f5ab59 100644 --- a/src/applications/search/controller/PhabricatorSearchEditController.php +++ b/src/applications/search/controller/PhabricatorSearchEditController.php @@ -66,11 +66,6 @@ final class PhabricatorSearchEditController } } - if ($errors) { - $errors = id(new AphrontErrorView()) - ->setErrors($errors); - } - $form = id(new AphrontFormView()) ->setUser($user); @@ -94,7 +89,7 @@ final class PhabricatorSearchEditController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($errors) + ->setFormErrors($errors) ->setForm($form); $crumbs = $this->buildApplicationCrumbs(); diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelAccount.php b/src/applications/settings/panel/PhabricatorSettingsPanelAccount.php index 2a2443aeac..0c291f2996 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelAccount.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelAccount.php @@ -51,21 +51,6 @@ final class PhabricatorSettingsPanelAccount } } - $notice = null; - if (!$errors) { - if ($request->getStr('saved')) { - $notice = new AphrontErrorView(); - $notice->setSeverity(AphrontErrorView::SEVERITY_NOTICE); - $notice->setTitle(pht('Changes Saved')); - $notice->appendChild( - phutil_tag('p', array(), pht('Your changes have been saved.'))); - $notice = $notice->render(); - } - } else { - $notice = new AphrontErrorView(); - $notice->setErrors($errors); - } - $timezone_ids = DateTimeZone::listIdentifiers(); $timezone_id_map = array_fuse($timezone_ids); @@ -139,10 +124,11 @@ final class PhabricatorSettingsPanelAccount $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Account Settings')) + ->setFormSaved($request->getStr('saved')) + ->setFormErrors($errors) ->setForm($form); return array( - $notice, $form_box, ); } diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelConpherencePreferences.php b/src/applications/settings/panel/PhabricatorSettingsPanelConpherencePreferences.php index 0ebd964dae..0c9a5b8214 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelConpherencePreferences.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelConpherencePreferences.php @@ -59,16 +59,18 @@ final class PhabricatorSettingsPanelConpherencePreferences $error_view = null; if ($request->getBool('saved')) { $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Preferences Saved')) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) - ->setErrors(array(pht('Your preferences have been saved.'))); + ->appendChild(pht('Preferences Saved')) + ->setSeverity(AphrontErrorView::SEVERITY_NOTICE); } $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Conpherence Preferences')) - ->setFormError($error_view) ->setForm($form); + if ($error_view) { + $form_box->setErrorView($error_view); + } + return array( $form_box, ); diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelDeveloperPreferences.php b/src/applications/settings/panel/PhabricatorSettingsPanelDeveloperPreferences.php index e0de6482aa..3c23cc05a8 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelDeveloperPreferences.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelDeveloperPreferences.php @@ -85,17 +85,9 @@ final class PhabricatorSettingsPanelDeveloperPreferences id(new AphrontFormSubmitControl()) ->setValue(pht('Save Preferences'))); - $error_view = null; - if ($request->getBool('saved')) { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Preferences Saved')) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) - ->setErrors(array(pht('Your preferences have been saved.'))); - } - $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Developer Settings')) - ->setFormError($error_view) + ->setFormSaved($request->getBool('saved')) ->setForm($form); return array( diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelDiffPreferences.php b/src/applications/settings/panel/PhabricatorSettingsPanelDiffPreferences.php index efbb4ffd56..26115e3e77 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelDiffPreferences.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelDiffPreferences.php @@ -58,17 +58,9 @@ final class PhabricatorSettingsPanelDiffPreferences id(new AphrontFormSubmitControl()) ->setValue(pht('Save Preferences'))); - $error_view = null; - if ($request->getBool('saved')) { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Preferences Saved')) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) - ->setErrors(array(pht('Your preferences have been saved.'))); - } - $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Diff Preferences')) - ->setFormError($error_view) + ->setFormSaved($request->getBool('saved')) ->setForm($form); return array( diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php b/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php index 79d6d3d3b5..c97f9d6046 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php @@ -137,17 +137,9 @@ EXAMPLE; id(new AphrontFormSubmitControl()) ->setValue(pht('Save Preferences'))); - $error_view = null; - if ($request->getStr('saved') === 'true') { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Preferences Saved')) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) - ->setErrors(array(pht('Your preferences have been saved.'))); - } - $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Display Preferences')) - ->setFormError($error_view) + ->setFormSaved($request->getStr('saved') === 'true') ->setForm($form); return array( diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php b/src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php index f3045cc3ef..f38d6c0cb5 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php @@ -69,21 +69,6 @@ final class PhabricatorSettingsPanelEmailPreferences ->setURI($this->getPanelURI('?saved=true')); } - $notice = null; - if (!$errors) { - if ($request->getStr('saved')) { - $notice = new AphrontErrorView(); - $notice->setSeverity(AphrontErrorView::SEVERITY_NOTICE); - $notice->setTitle(pht('Changes Saved')); - $notice->appendChild( - phutil_tag('p', array(), pht('Your changes have been saved.'))); - } - } else { - $notice = new AphrontErrorView(); - $notice->setTitle(pht('Form Errors')); - $notice->setErrors($errors); - } - $re_prefix_default = PhabricatorEnv::getEnvConfig('metamta.re-prefix') ? pht('Enabled') : pht('Disabled'); @@ -218,7 +203,8 @@ final class PhabricatorSettingsPanelEmailPreferences $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Email Preferences')) - ->setFormError($notice) + ->setFormSaved($request->getStr('saved')) + ->setFormErrors($errors) ->setForm($form); return id(new AphrontNullView()) diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelPassword.php b/src/applications/settings/panel/PhabricatorSettingsPanelPassword.php index 69e9170ed5..e872437c02 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelPassword.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelPassword.php @@ -108,21 +108,6 @@ final class PhabricatorSettingsPanelPassword } } - $notice = null; - if (!$errors) { - if ($request->getStr('saved')) { - $notice = new AphrontErrorView(); - $notice->setSeverity(AphrontErrorView::SEVERITY_NOTICE); - $notice->setTitle(pht('Changes Saved')); - $notice->appendChild( - phutil_tag('p', array(), pht('Your password has been updated.'))); - } - } else { - $notice = new AphrontErrorView(); - $notice->setTitle(pht('Error Changing Password')); - $notice->setErrors($errors); - } - $len_caption = null; if ($min_len) { $len_caption = pht('Minimum password length: %d characters.', $min_len); @@ -161,7 +146,8 @@ final class PhabricatorSettingsPanelPassword $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Change Password')) - ->setFormError($notice) + ->setFormSaved($request->getStr('saved')) + ->setFormErrors($errors) ->setForm($form); return array( diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php b/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php index 339b62d472..f89aeefd54 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php @@ -126,13 +126,6 @@ final class PhabricatorSettingsPanelSSHKeys } } - $error_view = null; - if ($errors) { - $error_view = new AphrontErrorView(); - $error_view->setTitle(pht('Form Errors')); - $error_view->setErrors($errors); - } - $is_new = !$key->getID(); if ($is_new) { @@ -165,7 +158,7 @@ final class PhabricatorSettingsPanelSSHKeys $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($header) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); return $form_box; diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelSearchPreferences.php b/src/applications/settings/panel/PhabricatorSettingsPanelSearchPreferences.php index 1e261a68fb..4330a6dc93 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelSearchPreferences.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelSearchPreferences.php @@ -50,17 +50,9 @@ final class PhabricatorSettingsPanelSearchPreferences id(new AphrontFormSubmitControl()) ->setValue(pht('Save'))); - $error_view = null; - if ($request->getStr('saved') === 'true') { - $error_view = id(new AphrontErrorView()) - ->setTitle(pht('Preferences Saved')) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) - ->setErrors(array(pht('Your preferences have been saved.'))); - } - $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Search Preferences')) - ->setFormError($error_view) + ->setFormSaved($request->getStr('saved') === 'true') ->setForm($form); return array( diff --git a/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php b/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php index a94a15872f..4154fa3020 100644 --- a/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php +++ b/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php @@ -123,13 +123,6 @@ final class PhabricatorSlowvoteEditController } } - $error_view = null; - if ($errors) { - $error_view = new AphrontErrorView(); - $error_view->setTitle(pht('Form Errors')); - $error_view->setErrors($errors); - } - $instructions = phutil_tag( 'p', @@ -248,7 +241,7 @@ final class PhabricatorSlowvoteEditController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) - ->setFormError($error_view) + ->setFormErrors($errors) ->setForm($form); return $this->buildApplicationPage( diff --git a/src/view/form/PHUIPagedFormView.php b/src/view/form/PHUIPagedFormView.php index d68c5bbe2c..034c86a1eb 100644 --- a/src/view/form/PHUIPagedFormView.php +++ b/src/view/form/PHUIPagedFormView.php @@ -262,12 +262,8 @@ final class PHUIPagedFormView extends AphrontTagView { $form->appendChild($selected_page); $form->appendChild($submit); - if ($errors) { - $errors = id(new AphrontErrorView())->setErrors($errors); - } - $box = id(new PHUIObjectBoxView()) - ->setFormError($errors) + ->setFormErrors($errors) ->setForm($form); if ($selected_page->getPageName()) { diff --git a/src/view/phui/PHUIObjectBoxView.php b/src/view/phui/PHUIObjectBoxView.php index 4ec8f9296b..a419d91fb4 100644 --- a/src/view/phui/PHUIObjectBoxView.php +++ b/src/view/phui/PHUIObjectBoxView.php @@ -3,7 +3,9 @@ final class PHUIObjectBoxView extends AphrontView { private $headerText; - private $formError = null; + private $formErrors = null; + private $formSaved = false; + private $errorView; private $form; private $validationException; private $header; @@ -64,8 +66,30 @@ final class PHUIObjectBoxView extends AphrontView { return $this; } - public function setFormError($error) { - $this->formError = $error; + public function setFormErrors(array $errors, $title = null) { + if (nonempty($errors)) { + $this->formErrors = id(new AphrontErrorView()) + ->setTitle($title) + ->setErrors($errors); + } + return $this; + } + + public function setFormSaved($saved, $text = null) { + if (!$text) { + $text = pht('Changes saved.'); + } + if ($saved) { + $save = id(new AphrontErrorView()) + ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) + ->appendChild($text); + $this->formSaved = $save; + } + return $this; + } + + public function setErrorView(AphrontErrorView $view) { + $this->errorView = $view; return $this; } @@ -193,7 +217,9 @@ final class PHUIObjectBoxView extends AphrontView { ->appendChild( array( $header, - $this->formError, + $this->errorView, + $this->formErrors, + $this->formSaved, $exception_errors, $this->form, $tabs, diff --git a/webroot/rsrc/css/aphront/error-view.css b/webroot/rsrc/css/aphront/error-view.css index ab83a89680..0bb9a52cc3 100644 --- a/webroot/rsrc/css/aphront/error-view.css +++ b/webroot/rsrc/css/aphront/error-view.css @@ -9,7 +9,7 @@ } form.aphront-dialog-view .aphront-error-view { - margin: 8px 0; + margin: 0 0 12px 0; } .aphront-error-view {