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

Pholio - fix show older transactions for if there are inline comments

Summary: We didn't load enough data for this case for the custom view class Pholio uses. Fixes T6770. Re-jiggers the signature of the loadImages function in the PholioMockQuery to get there so as to not duplicate any business logic.

Test Plan: made a pholio mock with lots of inline comments. pre-patch "show older" fatals and post-patch "show older" works

Reviewers: chad, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6770

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

+11 -4
+7 -4
src/applications/pholio/query/PholioMockQuery.php
··· 68 68 $mocks = $table->loadAllFromArray($data); 69 69 70 70 if ($mocks && $this->needImages) { 71 - $this->loadImages($mocks); 71 + self::loadImages($this->getViewer(), $mocks, $this->needInlineComments); 72 72 } 73 73 74 74 if ($mocks && $this->needCoverFiles) { ··· 118 118 return $this->formatWhereClause($where); 119 119 } 120 120 121 - private function loadImages(array $mocks) { 121 + public static function loadImages( 122 + PhabricatorUser $viewer, 123 + array $mocks, 124 + $need_inline_comments) { 122 125 assert_instances_of($mocks, 'PholioMock'); 123 126 124 127 $mock_map = mpull($mocks, null, 'getID'); 125 128 $all_images = id(new PholioImageQuery()) 126 - ->setViewer($this->getViewer()) 129 + ->setViewer($viewer) 127 130 ->setMockCache($mock_map) 128 131 ->withMockIDs(array_keys($mock_map)) 129 - ->needInlineComments($this->needInlineComments) 132 + ->needInlineComments($need_inline_comments) 130 133 ->execute(); 131 134 132 135 $image_groups = mgroup($all_images, 'getMockID');
+4
src/applications/pholio/storage/PholioMock.php
··· 268 268 PhabricatorApplicationTransactionView $timeline, 269 269 AphrontRequest $request) { 270 270 271 + PholioMockQuery::loadImages( 272 + $request->getUser(), 273 + array($this), 274 + $need_inline_comments = true); 271 275 $timeline->setMock($this); 272 276 return $timeline; 273 277 }