@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Record a "series parent PHID" on Calendar events that retains relationships after forks

Summary:
When you edit "X and all future events", X becomes the new parent of an event series.

Currently, it loses its relationship to its original parent. Instead, retain that relationship -- it's separate from the normal "parent", but we can use it to make the UI more clear or tweak behaviors later.

This mostly just keeps us from losing/destroying data that we might need/want later.

Test Plan:
- Ran migrations.
- Cancelled "X and all future events", saw sensible-appearing beahvior in the database for "seriesParentPHID".

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D16780

+23
+5
resources/sql/autopatches/20161031.calendar.01.seriesparent.sql
··· 1 + ALTER TABLE {$NAMESPACE}_calendar.calendar_event 2 + ADD seriesParentPHID VARBINARY(64); 3 + 4 + UPDATE {$NAMESPACE}_calendar.calendar_event 5 + SET seriesParentPHID = instanceOfEventPHID;
+7
src/applications/calendar/controller/PhabricatorCalendarEventCancelController.php
··· 84 84 // NOTE: If you can't edit some of the future events, we just 85 85 // don't try to update them. This seems like it's probably what 86 86 // users are likely to expect. 87 + 88 + // NOTE: This only affects events that are currently in the same 89 + // series, not all events that were ever in the original series. 90 + // We could use series PHIDs instead of parent PHIDs to affect more 91 + // events if this turns out to be counterintuitive. Other 92 + // applications differ in their behavior. 93 + 87 94 $future = id(new PhabricatorCalendarEventQuery()) 88 95 ->setViewer($viewer) 89 96 ->withParentEventPHIDs(array($event->getPHID()))
+11
src/applications/calendar/storage/PhabricatorCalendarEvent.php
··· 27 27 28 28 protected $isRecurring = 0; 29 29 30 + protected $seriesParentPHID; 30 31 protected $instanceOfEventPHID; 31 32 protected $sequenceIndex; 32 33 ··· 140 141 'a recurring parent event!')); 141 142 } 142 143 144 + $series_phid = $this->getSeriesParentPHID(); 145 + if (!$series_phid) { 146 + $series_phid = $this->getPHID(); 147 + } 148 + 143 149 $child = id(new self()) 144 150 ->setIsCancelled(0) 145 151 ->setIsStub(0) 146 152 ->setInstanceOfEventPHID($this->getPHID()) 153 + ->setSeriesParentPHID($series_phid) 147 154 ->setSequenceIndex($sequence) 148 155 ->setIsRecurring(true) 149 156 ->attachParentEvent($this) ··· 401 408 'icon' => 'text32', 402 409 'mailKey' => 'bytes20', 403 410 'isRecurring' => 'bool', 411 + 'seriesParentPHID' => 'phid?', 404 412 'instanceOfEventPHID' => 'phid?', 405 413 'sequenceIndex' => 'uint32?', 406 414 'isStub' => 'bool', ··· 434 442 'key_rdate' => array( 435 443 'columns' => array('instanceOfEventPHID', 'utcInstanceEpoch'), 436 444 'unique' => true, 445 + ), 446 + 'key_series' => array( 447 + 'columns' => array('seriesParentPHID', 'utcInitialEpoch'), 437 448 ), 438 449 ), 439 450 self::CONFIG_SERIALIZATION => array(