1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-01 18:30:59 +01:00

Don't fail with no image macros

Summary: .. IN (%Ls) with no file phids fails miserably.

Test Plan:
Went to /file/macro/ with and without patch. An exception is thrown
without it.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: 1063
This commit is contained in:
David Reuss 2011-10-28 08:06:30 -07:00 committed by epriestley
parent 0d5b0f21ad
commit c724902ca9

View file

@ -43,12 +43,16 @@ class PhabricatorFileMacroListController extends PhabricatorFileController {
$pager->setURI($request->getRequestURI(), 'page'); $pager->setURI($request->getRequestURI(), 'page');
$file_phids = mpull($macros, 'getFilePHID'); $file_phids = mpull($macros, 'getFilePHID');
$files = id(new PhabricatorFile())->loadAllWhere(
"phid IN (%Ls)", $files = array();
$file_phids); if ($file_phids) {
$author_phids = mpull($files, 'getAuthorPHID', 'getPHID'); $files = id(new PhabricatorFile())->loadAllWhere(
$handles = id(new PhabricatorObjectHandleData($author_phids)) "phid IN (%Ls)",
->loadHandles(); $file_phids);
$author_phids = mpull($files, 'getAuthorPHID', 'getPHID');
$handles = id(new PhabricatorObjectHandleData($author_phids))
->loadHandles();
}
$rows = array(); $rows = array();
foreach ($macros as $macro) { foreach ($macros as $macro) {