Skip to content

Commit

Permalink
Merge pull request #21 from creative-commoners/pulls/1.0/ask-first
Browse files Browse the repository at this point in the history
FIX Return default history controller when no request is available in injector
  • Loading branch information
robbieaverill authored Jun 12, 2018
2 parents 1f314fb + b9cce22 commit 984a84b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Controllers/HistoryControllerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ class HistoryControllerFactory implements Factory

public function create($service, array $params = array())
{
// If no request is available yet, return the default controller
if (!Injector::inst()->has(HTTPRequest::class)) {
return new CMSPageHistoryController();
}
$request = Injector::inst()->get(HTTPRequest::class);
$id = $request->param('ID');

Expand Down

0 comments on commit 984a84b

Please sign in to comment.