Skip to content

Commit

Permalink
CS-5630: Moves admin interface check to IssueListener from IssueService
Browse files Browse the repository at this point in the history
  • Loading branch information
m038 committed Jan 14, 2015
1 parent 8323e7f commit b9cdf3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions newscoop/library/Newscoop/Services/IssueService.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ public function issueResolver(Request $request)
$uriParts = array_filter(explode('/', $request->getRequestUri()));
$uriPartsCount = count($uriParts);
$issue = null;
// Don't try to resolve issues for the admin interface
if (!in_array('admin', $uriParts) && $uriPartsCount >= 2 && $uriPartsCount <= 5) {
if ($uriPartsCount >= 2 && $uriPartsCount <= 5) {
$publication = $this->publicationService->getPublication();
$cacheKey = $this->cacheService->getCacheKey(array(
'resolver',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public function __construct(IssueService $issueService)
*/
public function onRequest(GetResponseEvent $event)
{
$this->issueService->issueResolver($event->getRequest());
$onAdminInterface = strpos($event->getRequest()->getRequestUri(), '/admin');
if ($onAdminInterface === false) {
$this->issueService->issueResolver($event->getRequest());
}
}
}

0 comments on commit b9cdf3c

Please sign in to comment.