mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00: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:
parent
ed4c7893e9
commit
f24ae96bb6
2 changed files with 11 additions and 4 deletions
|
@ -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');
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue