Merge pull request #109 from tractorcow/3.1-api-updaterelativelink

API Hook into SiteTreeExtension::updateRelativeLink
This commit is contained in:
Ingo Schommer 2013-05-17 05:04:12 -07:00
commit f7eee8596d

View File

@ -1021,6 +1021,14 @@ class Translatable extends DataExtension implements PermissionProvider {
$this->addTranslatableFields($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 * This method can be called multiple times on the same FieldList
* because it checks which fields have already been added or modified. * because it checks which fields have already been added or modified.