From 1bbec96aa13cbcaddfcbf5c45ba394b580f6d4df Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 13 Oct 2010 01:01:38 +0000 Subject: [PATCH] BUGFIX Don't replace "home/" URLSegment in SiteTree->RelativeLink() if Translatable is enabled and the homepage is not on the root level (nested URLs allows you to have homepages called "en/home" and "ru/home") (fixes #5244) (from r101711) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112025 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/SiteTree.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index e96761757..6d7006ded 100755 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -389,8 +389,9 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid // Unset base for homepage URLSegments in their default language. // Homepages with action parameters or in different languages - // need to retain their URLSegment. - if(!$action && $base == RootURLController::get_homepage_link()) { + // need to retain their URLSegment. We can only do this if the homepage + // is on the root level. + if(!$action && $base == RootURLController::get_homepage_link() && !$this->ParentID) { $base = null; if($this->hasExtension('Translatable') && $this->Locale != Translatable::default_locale()){ $base = $this->URLSegment;