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

Minor, fix insertNotifications() for unmigrated callsites. See discussion in rP3a6ee79190b709d84ff79865d1c1d6234e5c102a.

+25 -21
+25 -21
src/applications/feed/PhabricatorFeedStoryPublisher.php
··· 104 104 105 105 106 106 private function insertNotifications($chrono_key) { 107 + if (!$this->subscribedPHIDs) { 108 + return; 109 + } 110 + 107 111 if (!$this->primaryObjectPHID) { 108 - throw 109 - new Exception("Call setPrimaryObjectPHID() before Publishing!"); 112 + throw new Exception( 113 + "You must call setPrimaryObjectPHID() if you setSubscribedPHIDs()!"); 110 114 } 111 - if ($this->subscribedPHIDs) { 112 - $notif = new PhabricatorFeedStoryNotification(); 113 - $sql = array(); 114 - $conn = $notif->establishConnection('w'); 115 115 116 - foreach (array_unique($this->subscribedPHIDs) as $user_phid) { 117 - $sql[] = qsprintf( 118 - $conn, 119 - '(%s, %s, %s, %d)', 120 - $this->primaryObjectPHID, 121 - $user_phid, 122 - $chrono_key, 123 - 0); 124 - } 116 + $notif = new PhabricatorFeedStoryNotification(); 117 + $sql = array(); 118 + $conn = $notif->establishConnection('w'); 125 119 126 - queryfx( 120 + foreach (array_unique($this->subscribedPHIDs) as $user_phid) { 121 + $sql[] = qsprintf( 127 122 $conn, 128 - 'INSERT INTO %T 129 - (primaryObjectPHID, userPHID, chronologicalKey, hasViewed) 130 - VALUES %Q', 131 - $notif->getTableName(), 132 - implode(', ', $sql)); 123 + '(%s, %s, %s, %d)', 124 + $this->primaryObjectPHID, 125 + $user_phid, 126 + $chrono_key, 127 + 0); 133 128 } 134 129 130 + queryfx( 131 + $conn, 132 + 'INSERT INTO %T 133 + (primaryObjectPHID, userPHID, chronologicalKey, hasViewed) 134 + VALUES %Q', 135 + $notif->getTableName(), 136 + implode(', ', $sql)); 135 137 } 138 + 139 + 136 140 /** 137 141 * We generate a unique chronological key for each story type because we want 138 142 * to be able to page through the stream with a cursor (i.e., select stories