Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUGFIX Fixed URLSegment access for translated homepages in SiteTree->…

…RelativeLink (#4781, thanks martijn) (from r97211)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102434 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 36dbefedcff5500f1a6c6e4833f1c5c37f3c42e0 1 parent e717044
@chillu chillu authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 core/model/SiteTree.php
View
6 core/model/SiteTree.php
@@ -376,8 +376,14 @@ public function RelativeLink($action = null) {
$base = $this->URLSegment;
}
+ // 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()) {
$base = null;
+ if($this->hasExtension('Translatable') && $this->Locale != Translatable::default_locale()){
+ $base = $this->URLSegment;
+ }
}
if(is_string($action)) {
Please sign in to comment.
Something went wrong with that request. Please try again.