mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 09:05:59 +00:00
Merge pull request #126 from jthomerson/pulls/fix_populate_site_config_defaults
FIX: don't re-enable the locale filter if it wasn't enabled before
This commit is contained in:
commit
f951e43612
@ -1259,12 +1259,15 @@ class Translatable extends DataExtension implements PermissionProvider {
|
||||
if(DB::getConn()->isSchemaUpdating()) return;
|
||||
|
||||
// Find the best base translation for SiteConfig
|
||||
$enabled = Translatable::locale_filter_enabled();
|
||||
Translatable::disable_locale_filter();
|
||||
$existingConfig = SiteConfig::get()->filter(array(
|
||||
'Locale' => Translatable::default_locale()
|
||||
))->first();
|
||||
if(!$existingConfig) $existingConfig = SiteConfig::get()->first();
|
||||
Translatable::enable_locale_filter();
|
||||
if ($enabled) {
|
||||
Translatable::enable_locale_filter();
|
||||
}
|
||||
|
||||
// Stage this SiteConfig and copy into the current object
|
||||
if(
|
||||
|
Loading…
x
Reference in New Issue
Block a user