mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Writing Locale in Translatable->onBeforeWrite() regardless of the record ID existing (see #4232). This is more in line with Translatable->requireDefaultRecords() which automatically updates all NULL locale values anyway.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79194 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
362931b6f2
commit
de23d55a8b
@ -672,8 +672,9 @@ class Translatable extends DataObjectDecorator {
|
|||||||
// If language is not set explicitly, set it to current_locale.
|
// If language is not set explicitly, set it to current_locale.
|
||||||
// This might be a bit overzealous in assuming the language
|
// This might be a bit overzealous in assuming the language
|
||||||
// of the content, as a "single language" website might be expanded
|
// of the content, as a "single language" website might be expanded
|
||||||
// later on.
|
// later on. See {@link requireDefaultRecords()} for batch setting
|
||||||
if(!$this->owner->ID && !$this->owner->Locale) {
|
// of empty Locale columns on each dev/build call.
|
||||||
|
if(!$this->owner->Locale) {
|
||||||
$this->owner->Locale = Translatable::get_current_locale();
|
$this->owner->Locale = Translatable::get_current_locale();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user