1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 11:30:55 +01:00

When generating Calendar event stubs, inherit import properties

Summary:
Ref T10747. Previously, importing a recurring event failed to mark the instnaces of the event as imported.

Now, we copy the source/UID/importer over.

Test Plan: Imported a recurring event, viewed event series, saw all of them marked imported.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

Differential Revision: https://secure.phabricator.com/D16728
This commit is contained in:
epriestley 2016-10-19 09:18:16 -07:00
parent d860008b6a
commit c3de8f8305

View file

@ -179,11 +179,10 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
->setName($parent->getName()) ->setName($parent->getName())
->setDescription($parent->getDescription()); ->setDescription($parent->getDescription());
$sequence = $this->getSequenceIndex();
if ($start) { if ($start) {
$start_datetime = $start; $start_datetime = $start;
} else { } else {
$sequence = $this->getSequenceIndex();
$start_datetime = $parent->newSequenceIndexDateTime($sequence); $start_datetime = $parent->newSequenceIndexDateTime($sequence);
if (!$start_datetime) { if (!$start_datetime) {
@ -201,6 +200,19 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
->setStartDateTime($start_datetime) ->setStartDateTime($start_datetime)
->setEndDateTime($end_datetime); ->setEndDateTime($end_datetime);
if ($parent->isImportedEvent()) {
$full_uid = $parent->getImportUID().'/'.$start_datetime->getEpoch();
// NOTE: We don't attach the import source because this gets called
// from CalendarEventQuery while building ghosts, before we've loaded
// and attached sources. Possibly this sequence should be flipped.
$this
->setImportAuthorPHID($parent->getImportAuthorPHID())
->setImportSourcePHID($parent->getImportSourcePHID())
->setImportUID($full_uid);
}
return $this; return $this;
} }