mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-08 02:19:34 +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:
parent
46cf189413
commit
63fec9b97d
1 changed files with 28 additions and 0 deletions
|
@ -465,6 +465,34 @@ final class PhabricatorCalendarEventEditor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
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;
|
return $errors;
|
||||||
|
|
Loading…
Add table
Reference in a new issue