Page MenuHomePhabricator

Show informative errors when attempting to set a recurrence end date on a non-recurring event.
ClosedPublic

Authored by lpriestley on Jun 7 2015, 6:00 PM.
Tags
None
Referenced Files
F14455597: D13192.diff
Fri, Dec 27, 6:35 AM
Unknown Object (File)
Thu, Dec 19, 7:01 PM
Unknown Object (File)
Sun, Dec 15, 9:57 PM
Unknown Object (File)
Sat, Dec 14, 12:55 PM
Unknown Object (File)
Wed, Dec 11, 12:50 AM
Unknown Object (File)
Tue, Dec 3, 10:05 PM
Unknown Object (File)
Tue, Dec 3, 5:27 PM
Unknown Object (File)
Nov 27 2024, 5:09 PM
Subscribers

Details

Summary

Fixes T8458, Show informative errors when attempting to set a recurrence end date on a non-recurring event.

Test Plan

Create new event, set recurrence end date via date-picker without setting the "is recurring" checkbox, and attempt to save. Should get error saying there cannot be a recurrence end date on a non-recurring event.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lpriestley retitled this revision from to Show informative errors when attempting to set a recurrence end date on a non-recurring event..
lpriestley updated this object.
lpriestley edited the test plan for this revision. (Show Details)
lpriestley added a reviewer: epriestley.
epriestley edited edge metadata.

What about just hiding the field if the event isn't recurring (or even making creation of recurring vs non-recurring events modal, so you don't have to do any JS wizardry)?

One inline with a technical issue.

src/applications/calendar/editor/PhabricatorCalendarEventEditor.php
304

We may reach this code with $recurrence_end_enabled and $is_recurring not defined.

(For example, I'd expect canceling an event to fail with an error here.)

This revision now requires changes to proceed.Jun 7 2015, 7:06 PM

I'm not sure about making it modal. When the options are private, public, and recurring, it's very ambiguous if recurring will be private or public. I want to think about it some more before committing to that.

lpriestley edited edge metadata.

Initializing end date and recurring so that they don't throw an error when null in editor.

epriestley edited edge metadata.
epriestley added inline comments.
src/applications/calendar/editor/PhabricatorCalendarEventEditor.php
279–280

These might need to be be $object->getIsRecurring() and $object->getRecurrenceEndDate() or similar, you might be able to sneak this through by doing it in two transactions now (remove recurring first, then edit again and add an end date).

This revision is now accepted and ready to land.Jun 7 2015, 10:43 PM
lpriestley edited edge metadata.

switch from end date enabled to just end date. simpler, and more clear.

src/applications/calendar/editor/PhabricatorCalendarEventEditor.php
279–280

Okay, just switching to recurrence_end instead of recurrence_end_enabled. Seems like that would make more sense anyways, despite the ui preventing edits to recurring events.

This revision was automatically updated to reflect the committed changes.