mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
ENHANCEMENT Removing specialized routing for Translatable from Director->currentPage() and ModelAsController->getNestedController. Calls SiteTree::get_by_url() now, which abstracts out the Translatable handling.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@69952 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
fb113e589e
commit
0cd41ac16d
@ -287,11 +287,7 @@ class Director {
|
||||
static function currentPage() {
|
||||
if(isset(Director::$urlParams['URLSegment'])) {
|
||||
$SQL_urlSegment = Convert::raw2sql(Director::$urlParams['URLSegment']);
|
||||
if (Translatable::is_enabled()) {
|
||||
return Translatable::get_one("SiteTree", "URLSegment = '$SQL_urlSegment'");
|
||||
} else {
|
||||
return DataObject::get_one("SiteTree", "URLSegment = '$SQL_urlSegment'");
|
||||
}
|
||||
return SiteTree::get_by_url($SQL_urlSegment);
|
||||
} else {
|
||||
return Controller::curr();
|
||||
}
|
||||
|
@ -32,11 +32,8 @@ class ModelAsController extends Controller implements NestedController {
|
||||
public function getNestedController() {
|
||||
if($this->urlParams['URLSegment']) {
|
||||
$SQL_URLSegment = Convert::raw2sql($this->urlParams['URLSegment']);
|
||||
if (Translatable::is_enabled()) {
|
||||
$child = Translatable::get_one("SiteTree", "URLSegment = '$SQL_URLSegment'", false);
|
||||
} else {
|
||||
$child = DataObject::get_one("SiteTree", "URLSegment = '$SQL_URLSegment'", false);
|
||||
}
|
||||
$child = SiteTree::get_by_url($SQL_URLSegment);
|
||||
|
||||
if(!$child) {
|
||||
if($child = $this->findOldPage($SQL_URLSegment)) {
|
||||
$url = Controller::join_links(
|
||||
|
Loading…
x
Reference in New Issue
Block a user