From 4ceb428cb5556f1d8e2a169322edb3b51bd47640 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 16 Sep 2007 16:12:07 +0000 Subject: [PATCH] bfojcapell: If we are visiting a multilingual site Translatable::get_one should be used (merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@42114 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/control/Director.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/control/Director.php b/core/control/Director.php index a28a4316d..a383618b8 100644 --- a/core/control/Director.php +++ b/core/control/Director.php @@ -125,6 +125,7 @@ class Director { if($_REQUEST['debug'] == 1) Debug::message("Redirecting to $controller"); if(isset($_GET['debug_profile'])) Profiler::unmark("Director","getControllerForURL"); + return "redirect:" . Director::absoluteURL(substr($controller,2), true); } else { @@ -147,6 +148,7 @@ class Director { if(isset($arguments['URLSegment'])) self::$urlSegment = $arguments['URLSegment'] . "/"; if(isset($_GET['debug_profile'])) Profiler::unmark("Director","getControllerForURL"); + return $controllerObj; } } @@ -165,7 +167,11 @@ class Director { static function currentPage() { if(isset(Director::$urlParams['URLSegment'])) { $SQL_urlSegment = Convert::raw2sql(Director::$urlParams['URLSegment']); - return DataObject::get_one("SiteTree", "URLSegment = '$SQL_urlSegment'"); + if (Translatable::is_enabled()) { + return Translatable::get_one("SiteTree", "URLSegment = '$SQL_urlSegment'"); + } else { + return DataObject::get_one("SiteTree", "URLSegment = '$SQL_urlSegment'"); + } } else { return Controller::currentController(); }