Differential D19036 Diff 45644 src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionRepositoryURIViewController.php
| Show All 17 Lines | $uri = id(new PhabricatorRepositoryURIQuery()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->withIDs(array($id)) | ->withIDs(array($id)) | ||||
| ->withRepositories(array($repository)) | ->withRepositories(array($repository)) | ||||
| ->executeOne(); | ->executeOne(); | ||||
| if (!$uri) { | if (!$uri) { | ||||
| return new Aphront404Response(); | return new Aphront404Response(); | ||||
| } | } | ||||
| // For display, reload the URI by loading it through the repository. This | // For display, access the URI by loading it through the repository. This | ||||
| // may adjust builtin URIs for repository configuration, so we may end up | // may adjust builtin URIs for repository configuration, so we may end up | ||||
| // with a different view of builtin URIs than we'd see if we loaded them | // with a different view of builtin URIs than we'd see if we loaded them | ||||
| // directly from the database. See T12884. | // directly from the database. See T12884. | ||||
| $repository_with_uris = id(new PhabricatorRepositoryQuery()) | |||||
| ->setViewer($viewer) | |||||
| ->needURIs(true) | |||||
| ->execute(); | |||||
| $repository_uris = $repository->getURIs(); | $repository_uris = $repository->getURIs(); | ||||
| $repository_uris = mpull($repository_uris, null, 'getID'); | $repository_uris = mpull($repository_uris, null, 'getID'); | ||||
| $uri = idx($repository_uris, $uri->getID()); | $uri = idx($repository_uris, $uri->getID()); | ||||
| if (!$uri) { | if (!$uri) { | ||||
| return new Aphront404Response(); | return new Aphront404Response(); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 274 Lines • Show Last 20 Lines | |||||