From 27a537c15ffeae1e1a5487cbfc0eb2f23495eceb Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 9 Feb 2013 13:28:51 -0800 Subject: [PATCH] When viewing a thread with no picture, load no images instead of all images Summary: Currently, we select every file when looking at a thread with no splash image. (Possibly the Query stuff should try to catch this.) Test Plan: No more `SELECT * FROM files` query. Reviewers: chad, btrahan, vrana Reviewed By: vrana CC: aran Differential Revision: https://secure.phabricator.com/D4887 --- .../conpherence/query/ConpherenceThreadQuery.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/applications/conpherence/query/ConpherenceThreadQuery.php b/src/applications/conpherence/query/ConpherenceThreadQuery.php index e21951cf09..a5038b410e 100644 --- a/src/applications/conpherence/query/ConpherenceThreadQuery.php +++ b/src/applications/conpherence/query/ConpherenceThreadQuery.php @@ -227,6 +227,11 @@ final class ConpherenceThreadQuery $conpherence_pic_phids[$conpherence->getPHID()] = $phid; } } + + if (!$conpherence_pic_phids) { + return $this; + } + $files = id(new PhabricatorFileQuery()) ->setViewer($this->getViewer()) ->withPHIDs($conpherence_pic_phids)