Page MenuHomePhabricator

D11002.diff
No OneTemporary

D11002.diff

diff --git a/src/applications/pholio/query/PholioMockQuery.php b/src/applications/pholio/query/PholioMockQuery.php
--- a/src/applications/pholio/query/PholioMockQuery.php
+++ b/src/applications/pholio/query/PholioMockQuery.php
@@ -68,7 +68,7 @@
$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 @@
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');
diff --git a/src/applications/pholio/storage/PholioMock.php b/src/applications/pholio/storage/PholioMock.php
--- a/src/applications/pholio/storage/PholioMock.php
+++ b/src/applications/pholio/storage/PholioMock.php
@@ -268,6 +268,10 @@
PhabricatorApplicationTransactionView $timeline,
AphrontRequest $request) {
+ PholioMockQuery::loadImages(
+ $request->getUser(),
+ array($this),
+ $need_inline_comments = true);
$timeline->setMock($this);
return $timeline;
}

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 12, 7:59 PM (6 d, 10 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6734504
Default Alt Text
D11002.diff (1 KB)

Event Timeline