@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.

Query for recurring event parents should accept a "not a child of anything" clause

Summary: Closes T8371, Query for recurring event parents should accept a "not a child of anything" clause

Test Plan: querying for a list of events with recurring events should still work the same.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T8371

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

+14 -3
+14 -3
src/applications/calendar/query/PhabricatorCalendarEventQuery.php
··· 10 10 private $inviteePHIDs; 11 11 private $creatorPHIDs; 12 12 private $isCancelled; 13 + private $eventsWithNoParent; 13 14 private $instanceSequencePairs; 14 15 15 16 private $generateGhosts = false; ··· 47 48 48 49 public function withIsCancelled($is_cancelled) { 49 50 $this->isCancelled = $is_cancelled; 51 + return $this; 52 + } 53 + 54 + public function withEventsWithNoParent($events_with_no_parent) { 55 + $this->eventsWithNoParent = $events_with_no_parent; 50 56 return $this; 51 57 } 52 58 ··· 272 278 (int)$this->isCancelled); 273 279 } 274 280 281 + if ($this->eventsWithNoParent == true) { 282 + $where[] = qsprintf( 283 + $conn_r, 284 + 'event.instanceOfEventPHID IS NULL'); 285 + } 286 + 275 287 if ($this->instanceSequencePairs !== null) { 276 288 $sql = array(); 277 289 ··· 339 351 $instance_of = $event->getInstanceOfEventPHID(); 340 352 341 353 if ($instance_of) { 342 - if ($instance_of != $event->getPHID() || $event->getIsGhostEvent()) { 343 - $instance_of_event_phids[] = $event->getInstanceOfEventPHID(); 344 - } 354 + $instance_of_event_phids[] = $instance_of; 345 355 } 346 356 } 347 357 ··· 349 359 $recurring_events = id(new PhabricatorCalendarEventQuery()) 350 360 ->setViewer($viewer) 351 361 ->withPHIDs($instance_of_event_phids) 362 + ->withEventsWithNoParent(true) 352 363 ->execute(); 353 364 354 365 $recurring_events = mpull($recurring_events, null, 'getPHID');