1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 05:20:56 +01:00

Fix two minor issues with Pholio

Summary:
  - One bad method call.
  - One fatal when handling a mock with no images. These "can't" exist, but we have a few old ones I think and it's probably better not to fatal. We could filter the object out completely, but this doesn't seem like a bad fix?

Test Plan: Viewed `/pholio/` (although I don't think I have any imageless mocks) and viewed an outdated image.

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6574
This commit is contained in:
epriestley 2013-07-26 09:45:55 -07:00
parent 8514a3c739
commit 9827ea9c73
2 changed files with 2 additions and 2 deletions

View file

@ -134,7 +134,7 @@ final class PholioMockViewController extends PholioController {
$image = idx($images, $image_id);
if ($image) {
$history = $mock->getImageUpdateSet($image_id);
$history = $mock->getImageHistorySet($image_id);
$latest_image = last($history);
$href = $this->getApplicationURI(
'image/history/'.$latest_image->getID().'/');

View file

@ -122,7 +122,7 @@ final class PholioMockQuery
$image_groups = mgroup($all_images, 'getMockID');
foreach ($mocks as $mock) {
$mock_images = $image_groups[$mock->getID()];
$mock_images = idx($image_groups, $mock->getID(), array());
$mock->attachAllImages($mock_images);
$mock->attachImages(mfilter($mock_images, 'getIsObsolete', true));
}