mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 14:30:56 +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:
parent
4ae28837fd
commit
871c06ab4e
1 changed files with 18 additions and 10 deletions
|
@ -66,6 +66,13 @@ final class PhabricatorCalendarEventEditController
|
|||
$end_value = $end_time->readValueFromRequest($request);
|
||||
$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 {
|
||||
$status
|
||||
->setUserPHID($user->getPHID())
|
||||
|
@ -77,6 +84,7 @@ final class PhabricatorCalendarEventEditController
|
|||
} catch (PhabricatorCalendarEventInvalidEpochException $e) {
|
||||
$errors[] = pht('Start must be before end.');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$errors) {
|
||||
$uri = new PhutilURI($this->getApplicationURI());
|
||||
|
|
Loading…
Reference in a new issue