mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-22 04:31:13 +01:00
unbreak typeaheads for /owners/new
Summary: D6057 introduced images in the typeahead results, but not all projects return a valid result. This silently broke /owners/new because the exception "Call to a member function loadProfileImageURI() on a non-object" is swallowed somewhere in the handler. Test Plan: go to /owners/new and type something in the primary owner field Reviewers: epriestley, nh, Afaque_Hussain Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D6245
This commit is contained in:
parent
e2f0003ff9
commit
9a929508ee
1 changed files with 6 additions and 2 deletions
|
@ -206,12 +206,16 @@ final class PhabricatorTypeaheadCommonDatasourceController
|
||||||
->withStatus(PhabricatorProjectQuery::STATUS_OPEN)
|
->withStatus(PhabricatorProjectQuery::STATUS_OPEN)
|
||||||
->execute();
|
->execute();
|
||||||
foreach ($projs as $proj) {
|
foreach ($projs as $proj) {
|
||||||
$results[] = id(new PhabricatorTypeaheadResult())
|
$proj_result = id(new PhabricatorTypeaheadResult())
|
||||||
->setName($proj->getName())
|
->setName($proj->getName())
|
||||||
->setDisplayType("Project")
|
->setDisplayType("Project")
|
||||||
->setURI('/project/view/'.$proj->getID().'/')
|
->setURI('/project/view/'.$proj->getID().'/')
|
||||||
->setImageURI($proj->loadProfile()->loadProfileImageURI())
|
|
||||||
->setPHID($proj->getPHID());
|
->setPHID($proj->getPHID());
|
||||||
|
$prof = $proj->loadProfile();
|
||||||
|
if ($prof) {
|
||||||
|
$proj_result->setImageURI($prof->loadProfileImageURI());
|
||||||
|
}
|
||||||
|
$results[] = $proj_result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue