mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Don't try to load profile images for projects with no profile image
Summary: Ref T8631. Projects may not have a profile image PHID; don't try to load it if they don't. Test Plan: Saw `WHERE phid IN ('')` query stop happening on a local feed story page. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T8631 Differential Revision: https://secure.phabricator.com/D13476
This commit is contained in:
parent
594690ade9
commit
0ef1d4bc17
1 changed files with 12 additions and 6 deletions
|
@ -196,12 +196,18 @@ final class PhabricatorProjectQuery
|
||||||
$default = null;
|
$default = null;
|
||||||
|
|
||||||
$file_phids = mpull($projects, 'getProfileImagePHID');
|
$file_phids = mpull($projects, 'getProfileImagePHID');
|
||||||
$files = id(new PhabricatorFileQuery())
|
$file_phids = array_filter($file_phids);
|
||||||
->setParentQuery($this)
|
if ($file_phids) {
|
||||||
->setViewer($this->getViewer())
|
$files = id(new PhabricatorFileQuery())
|
||||||
->withPHIDs($file_phids)
|
->setParentQuery($this)
|
||||||
->execute();
|
->setViewer($this->getViewer())
|
||||||
$files = mpull($files, null, 'getPHID');
|
->withPHIDs($file_phids)
|
||||||
|
->execute();
|
||||||
|
$files = mpull($files, null, 'getPHID');
|
||||||
|
} else {
|
||||||
|
$files = array();
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($projects as $project) {
|
foreach ($projects as $project) {
|
||||||
$file = idx($files, $project->getProfileImagePHID());
|
$file = idx($files, $project->getProfileImagePHID());
|
||||||
if (!$file) {
|
if (!$file) {
|
||||||
|
|
Loading…
Reference in a new issue