1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00

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
This commit is contained in:
Bob Trahan 2014-12-17 09:42:37 -08:00
parent ed4c7893e9
commit f24ae96bb6
2 changed files with 11 additions and 4 deletions

View file

@ -68,7 +68,7 @@ final class PholioMockQuery
$mocks = $table->loadAllFromArray($data);
if ($mocks && $this->needImages) {
$this->loadImages($mocks);
self::loadImages($this->getViewer(), $mocks, $this->needInlineComments);
}
if ($mocks && $this->needCoverFiles) {
@ -118,15 +118,18 @@ final class PholioMockQuery
return $this->formatWhereClause($where);
}
private function loadImages(array $mocks) {
public static function loadImages(
PhabricatorUser $viewer,
array $mocks,
$need_inline_comments) {
assert_instances_of($mocks, 'PholioMock');
$mock_map = mpull($mocks, null, 'getID');
$all_images = id(new PholioImageQuery())
->setViewer($this->getViewer())
->setViewer($viewer)
->setMockCache($mock_map)
->withMockIDs(array_keys($mock_map))
->needInlineComments($this->needInlineComments)
->needInlineComments($need_inline_comments)
->execute();
$image_groups = mgroup($all_images, 'getMockID');

View file

@ -268,6 +268,10 @@ final class PholioMock extends PholioDAO
PhabricatorApplicationTransactionView $timeline,
AphrontRequest $request) {
PholioMockQuery::loadImages(
$request->getUser(),
array($this),
$need_inline_comments = true);
$timeline->setMock($this);
return $timeline;
}