Permalink
Browse files

BUGFIX Don't replace "home/" URLSegment in SiteTree->RelativeLink() i…

…f 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
  • Loading branch information...
sminnee committed Oct 13, 2010
1 parent ddeebf3 commit 1bbec96aa13cbcaddfcbf5c45ba394b580f6d4df
Showing with 3 additions and 2 deletions.
  1. +3 −2 core/model/SiteTree.php
View
@@ -389,8 +389,9 @@ public function RelativeLink($action = null) {
// 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;

0 comments on commit 1bbec96

Please sign in to comment.