1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 03:50:54 +01:00

Restore date validation errors to Calendar

Summary: Ref T9275. I waffled back and forth on these transactions a bit, but put these back here in better working order.

Test Plan: Tried to schedule an event on "taco".

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9275

Differential Revision: https://secure.phabricator.com/D16285
This commit is contained in:
epriestley 2016-07-12 14:39:24 -07:00
parent 46cf189413
commit 63fec9b97d

View file

@ -465,6 +465,34 @@ final class PhabricatorCalendarEventEditor
}
}
break;
case PhabricatorCalendarEventTransaction::TYPE_START_DATE:
case PhabricatorCalendarEventTransaction::TYPE_END_DATE:
case PhabricatorCalendarEventTransaction::TYPE_RECURRENCE_END_DATE:
foreach ($xactions as $xaction) {
if ($xaction->getNewValue()->isValid()) {
continue;
}
switch ($type) {
case PhabricatorCalendarEventTransaction::TYPE_START_DATE:
$message = pht('Start date is invalid.');
break;
case PhabricatorCalendarEventTransaction::TYPE_END_DATE:
$message = pht('End date is invalid.');
break;
case PhabricatorCalendarEventTransaction::TYPE_RECURRENCE_END_DATE:
$message = pht('Repeat until date is invalid.');
break;
}
$errors[] = new PhabricatorApplicationTransactionValidationError(
$type,
pht('Invalid'),
$message,
$xaction);
}
break;
}
return $errors;