1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-11 15:21:03 +01:00

Fix Pholio feed fatal

Summary: need to filter images that we can't find mocks for. Fixes T3645. Note I have some other errors in my feed which are really tricky to debug and might be garbage data; I want to see what happens in prod post this push.

Test Plan: set a mock visibility to no one and feed worked

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T3645

Differential Revision: https://secure.phabricator.com/D6631
This commit is contained in:
Bob Trahan 2013-07-30 12:27:44 -07:00
parent 8d21dc0d52
commit c6ae9c5672

View file

@ -138,8 +138,14 @@ final class PholioImageQuery
->execute();
$mocks = mpull($mocks, null, 'getID');
}
foreach ($images as $image) {
$image->attachMock($mocks[$image->getMockID()]);
foreach ($images as $index => $image) {
$mock = idx($mocks, $image->getMockID());
if ($mock) {
$image->attachMock($mock);
} else {
// mock is missing or we can't see it
unset($images[$index]);
}
}
return $images;