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)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@101711 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-03-25 22:14:50 +00:00 committed by Sam Minnee
parent 70ac42c577
commit 227dd2375c

View File

@ -395,8 +395,9 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
// Unset base for homepage URLSegments in their default language. // Unset base for homepage URLSegments in their default language.
// Homepages with action parameters or in different languages // Homepages with action parameters or in different languages
// need to retain their URLSegment. // need to retain their URLSegment. We can only do this if the homepage
if(!$action && $base == RootURLController::get_homepage_link()) { // is on the root level.
if(!$action && $base == RootURLController::get_homepage_link() && !$this->ParentID) {
$base = null; $base = null;
if($this->hasExtension('Translatable') && $this->Locale != Translatable::default_locale()){ if($this->hasExtension('Translatable') && $this->Locale != Translatable::default_locale()){
$base = $this->URLSegment; $base = $this->URLSegment;