mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
API Hook into SiteTreeExtension::updateRelativeLink
This commit is contained in:
parent
742fe8dee8
commit
ea4645af24
@ -1020,6 +1020,14 @@ class Translatable extends DataExtension implements PermissionProvider {
|
|||||||
function updateSettingsFields(&$fields) {
|
function updateSettingsFields(&$fields) {
|
||||||
$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
|
||||||
|
Loading…
Reference in New Issue
Block a user