Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fall back to global locale state for link updates (#139)

  • Loading branch information...
commit 63366327137f36ccd218bf39f07d7481a94e498d 1 parent 15e9037
@chillu chillu authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 code/controller/TranslatableCMSMainExtension.php
View
10 code/controller/TranslatableCMSMainExtension.php
@@ -139,19 +139,23 @@ function createtranslation($data, $form) {
}
function updateLink(&$link) {
- if($this->owner->Locale) $link = Controller::join_links($link, '?locale=' . $this->owner->Locale);
+ $locale = $this->owner->Locale ? $this->owner->Locale : Translatable::get_current_locale();
+ if($locale) $link = Controller::join_links($link, '?locale=' . $locale);
}
function updateLinkWithSearch(&$link) {
- if($this->owner->Locale) $link = Controller::join_links($link, '?locale=' . $this->owner->Locale);
+ $locale = $this->owner->Locale ? $this->owner->Locale : Translatable::get_current_locale();
+ if($locale) $link = Controller::join_links($link, '?locale=' . $locale);
}
function updateExtraTreeTools(&$html) {
+ $locale = $this->owner->Locale ? $this->owner->Locale : Translatable::get_current_locale();
$html = $this->LangForm()->forTemplate() . $html;
}
function updateLinkPageAdd(&$link) {
- if($this->owner->Locale) $link = Controller::join_links($link, '?Locale=' . $this->owner->Locale);
+ $locale = $this->owner->Locale ? $this->owner->Locale : Translatable::get_current_locale();
+ if($locale) $link = Controller::join_links($link, '?Locale=' . $locale);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.