mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
Merge pull request #48 from creamarketing/doube-ajax-panel-load
BUG: double ajax request for page editing in default locale
This commit is contained in:
commit
00140be705
@ -29,6 +29,11 @@ class TranslatableCMSMainExtension extends Extension {
|
|||||||
if($record && $record->Locale) $this->owner->Locale = $record->Locale;
|
if($record && $record->Locale) $this->owner->Locale = $record->Locale;
|
||||||
} else {
|
} else {
|
||||||
$this->owner->Locale = Translatable::default_locale();
|
$this->owner->Locale = Translatable::default_locale();
|
||||||
|
if ($this->owner->class == 'CMSPagesController') {
|
||||||
|
// the CMSPagesController always needs to have the locale set, otherwise page editing will cause an extra
|
||||||
|
// ajax request which looks weird due to multiple "loading"-flashes
|
||||||
|
return $this->owner->redirect($this->owner->Link());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Translatable::set_current_locale($this->owner->Locale);
|
Translatable::set_current_locale($this->owner->Locale);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user