1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

Partial fix for owners bug where a package's repository doesn't exist.

Summary: Avoid requesting a non-existent repository...

Test Plan: Delete a repo that has an associated owners package. Then verify that the owners list page no longer throws an exception.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1372

Differential Revision: https://secure.phabricator.com/D2776
This commit is contained in:
20after4 2012-06-18 06:04:20 -07:00 committed by epriestley
parent 6b8295d100
commit fea67c9858

View file

@ -262,23 +262,27 @@ final class PhabricatorOwnersListController
$pkg_paths = idx($paths, $package->getID(), array());
foreach ($pkg_paths as $key => $path) {
$repo = $repositories[$path->getRepositoryPHID()];
$drequest = DiffusionRequest::newFromDictionary(
array(
'repository' => $repo,
'path' => $path->getPath(),
));
$href = $drequest->generateURI(
array(
'action' => 'browse',
));
$pkg_paths[$key] =
'<strong>'.phutil_escape_html($repo->getName()).'</strong> '.
phutil_render_tag(
'a',
if ($repo) {
$drequest = DiffusionRequest::newFromDictionary(
array(
'href' => (string) $href,
),
phutil_escape_html($path->getPath()));
'repository' => $repo,
'path' => $path->getPath(),
));
$href = $drequest->generateURI(
array(
'action' => 'browse',
));
$pkg_paths[$key] =
'<strong>'.phutil_escape_html($repo->getName()).'</strong> '.
phutil_render_tag(
'a',
array(
'href' => (string) $href,
),
phutil_escape_html($path->getPath()));
} else {
$pkg_paths[$key] = phutil_escape_html($path->getPath());
}
}
$pkg_paths = implode('<br />', $pkg_paths);