From c2ad41ef1b13da2b29ed6d3b26aa7a092bfecd9c Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Fri, 23 Jun 2017 10:59:25 +1200 Subject: [PATCH] FIX Allow RedirectorPage to have non-redirected actions, move redirection to index --- code/Model/RedirectorPageController.php | 18 ++++++++++++------ tests/controller/ContentControllerTest.php | 1 - 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/code/Model/RedirectorPageController.php b/code/Model/RedirectorPageController.php index f92e3b27..9d53b87d 100644 --- a/code/Model/RedirectorPageController.php +++ b/code/Model/RedirectorPageController.php @@ -1,6 +1,7 @@ data(); if (!$this->getResponse()->isFinished() && $link = $page->redirectionLink()) { $this->redirect($link, 301); } + return parent::handleAction($request, 'handleIndex'); } /** * If we ever get this far, it means that the redirection failed. */ - public function Content() + public function getContent() { return "

" . - _t('SilverStripe\\CMS\\Model\\RedirectorPage.HASBEENSETUP', 'A redirector page has been set up without anywhere to redirect to.') . + _t(__CLASS__ . '.HASBEENSETUP', 'A redirector page has been set up without anywhere to redirect to.') . "

"; } } diff --git a/tests/controller/ContentControllerTest.php b/tests/controller/ContentControllerTest.php index 14a03ebc..604a3edc 100755 --- a/tests/controller/ContentControllerTest.php +++ b/tests/controller/ContentControllerTest.php @@ -204,4 +204,3 @@ class ContentControllerTest extends FunctionalTest }); } } -