From ea4645af242ffa8e3df3cbb3d72e44465997ac02 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Fri, 10 May 2013 12:23:36 +1200 Subject: [PATCH] API Hook into SiteTreeExtension::updateRelativeLink --- code/model/Translatable.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/model/Translatable.php b/code/model/Translatable.php index 39cc4c1..675c196 100755 --- a/code/model/Translatable.php +++ b/code/model/Translatable.php @@ -1020,6 +1020,14 @@ class Translatable extends DataExtension implements PermissionProvider { function updateSettingsFields(&$fields) { $this->addTranslatableFields($fields); } + + public function updateRelativeLink(&$base, &$action) { + // Prevent home pages for non-default locales having their urlsegments + // reduced to the site root. + if($base === null && $this->owner->Locale != self::default_locale()){ + $base = $this->owner->URLSegment; + } + } /** * This method can be called multiple times on the same FieldList