@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 this patch so it applies after `channel` got deleted from the event table.

Test plan: Applied the patch explicitly with `--apply`.

+18 -5
+18 -5
resources/sql/patches/20130218.updatechannelid.php
··· 11 11 $channel_table->beginReadLocking(); 12 12 13 13 $events = new LiskMigrationIterator($event_table); 14 + $conn_w = $channel_table->establishConnection('w'); 14 15 15 16 foreach ($events as $event) { 16 17 if ($event->getChannelID()) { 17 18 continue; 18 19 } 19 20 20 - $matched = $channel_table->loadOneWhere( 21 - "channelName = %s AND serviceName = %s AND serviceType = %s", 22 - $event->getChannel(), 21 + $event_row = queryfx_one( 22 + $conn_w, 23 + 'SELECT channel FROM %T WHERE id = %d', 24 + $event->getTable(), 25 + $event->getChannelID()); 26 + $event_channel = $event_row['channel']; 27 + 28 + $matched = queryfx_one( 29 + $conn_w, 30 + 'SELECT * FROM %T WHERE 31 + channelName = %s AND serviceName = %s AND serviceType = %s', 32 + $event_channel, 23 33 '', 24 34 ''); 25 35 26 36 if (!$matched) { 27 37 $matched = id(new PhabricatorChatLogChannel()) 28 - ->setChannelName($event->getChannel()) 38 + ->setChannelName($event_channel) 29 39 ->setServiceType('') 30 40 ->setServiceName('') 31 41 ->setViewPolicy(PhabricatorPolicies::POLICY_USER) 32 42 ->setEditPolicy(PhabricatorPolicies::POLICY_USER) 33 43 ->save(); 44 + $matched_id = $matched->getID(); 45 + } else { 46 + $matched_id = $matched['id']; 34 47 } 35 48 36 49 queryfx( 37 50 $event->establishConnection('w'), 38 51 'UPDATE %T SET channelID = %d WHERE id = %d', 39 52 $event->getTableName(), 40 - $matched->getID(), 53 + $matched_id, 41 54 $event->getID()); 42 55 } 43 56