mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 09:05:56 +00:00
BUGFIX: use sapphire as the default location. BUGFIX: fixed index templates being thrown as 404
This commit is contained in:
parent
9335c789af
commit
30b5134b80
@ -102,7 +102,6 @@ class DocumentationViewer extends Controller {
|
|||||||
* @return SS_HTTPResponse
|
* @return SS_HTTPResponse
|
||||||
*/
|
*/
|
||||||
public function handleRequest(SS_HTTPRequest $request) {
|
public function handleRequest(SS_HTTPRequest $request) {
|
||||||
|
|
||||||
// if we submitted a form, let that pass
|
// if we submitted a form, let that pass
|
||||||
if(!$request->isGET()) return parent::handleRequest($request);
|
if(!$request->isGET()) return parent::handleRequest($request);
|
||||||
|
|
||||||
@ -111,7 +110,7 @@ class DocumentationViewer extends Controller {
|
|||||||
$thirdParam = $request->shift();
|
$thirdParam = $request->shift();
|
||||||
|
|
||||||
$this->Remaining = $request->shift(10);
|
$this->Remaining = $request->shift(10);
|
||||||
|
|
||||||
DocumentationService::load_automatic_registration();
|
DocumentationService::load_automatic_registration();
|
||||||
|
|
||||||
if(isset($firstParam)) {
|
if(isset($firstParam)) {
|
||||||
@ -146,7 +145,7 @@ class DocumentationViewer extends Controller {
|
|||||||
|
|
||||||
// 'current' version mapping
|
// 'current' version mapping
|
||||||
$module = DocumentationService::is_registered_module($this->module, null, $this->getLang());
|
$module = DocumentationService::is_registered_module($this->module, null, $this->getLang());
|
||||||
|
|
||||||
if($module && $this->getVersion()) {
|
if($module && $this->getVersion()) {
|
||||||
$current = $module->getCurrentVersion();
|
$current = $module->getCurrentVersion();
|
||||||
|
|
||||||
@ -158,6 +157,7 @@ class DocumentationViewer extends Controller {
|
|||||||
$this->version = 'current';
|
$this->version = 'current';
|
||||||
$link = $this->Link($this->Remaining);
|
$link = $this->Link($this->Remaining);
|
||||||
$this->response = new SS_HTTPResponse();
|
$this->response = new SS_HTTPResponse();
|
||||||
|
|
||||||
$this->redirect($link, 301); // permanent redirect
|
$this->redirect($link, 301); // permanent redirect
|
||||||
|
|
||||||
return $this->response;
|
return $this->response;
|
||||||
@ -392,7 +392,7 @@ class DocumentationViewer extends Controller {
|
|||||||
$linkParts = array();
|
$linkParts = array();
|
||||||
|
|
||||||
// don't include the 'index in the url
|
// don't include the 'index in the url
|
||||||
if($page->Title != "Index") $linkParts[] = $page->Filename;
|
if(strtolower($page->Title) != "index") $linkParts[] = $page->Filename;
|
||||||
|
|
||||||
$page->Link = $this->Link($linkParts);
|
$page->Link = $this->Link($linkParts);
|
||||||
$page->LinkingMode = 'link';
|
$page->LinkingMode = 'link';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user