1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-25 06:50:55 +01:00

Calendar - error better with invalid time values

Summary: Fixes T7665. Unfortunately when the user messes this up its not easy to partially recover so we just reset that time to the default.

Test Plan: set time to "00:00 AM" and got a sensible error.

Reviewers: chad, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7665

Differential Revision: https://secure.phabricator.com/D12174
This commit is contained in:
Bob Trahan 2015-03-26 13:02:49 -07:00
parent 4ae28837fd
commit 871c06ab4e

View file

@ -66,6 +66,13 @@ final class PhabricatorCalendarEventEditController
$end_value = $end_time->readValueFromRequest($request); $end_value = $end_time->readValueFromRequest($request);
$description = $request->getStr('description'); $description = $request->getStr('description');
if ($start_time->getError()) {
$errors[] = pht('Invalid start time; reset to default.');
}
if ($end_time->getError()) {
$errors[] = pht('Invalid end time; reset to default.');
}
if (!$errors) {
try { try {
$status $status
->setUserPHID($user->getPHID()) ->setUserPHID($user->getPHID())
@ -77,6 +84,7 @@ final class PhabricatorCalendarEventEditController
} catch (PhabricatorCalendarEventInvalidEpochException $e) { } catch (PhabricatorCalendarEventInvalidEpochException $e) {
$errors[] = pht('Start must be before end.'); $errors[] = pht('Start must be before end.');
} }
}
if (!$errors) { if (!$errors) {
$uri = new PhutilURI($this->getApplicationURI()); $uri = new PhutilURI($this->getApplicationURI());