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:
Ingo Schommer 2009-06-15 04:34:03 +00:00
parent 362931b6f2
commit de23d55a8b

View File

@ -672,8 +672,9 @@ class Translatable extends DataObjectDecorator {
// If language is not set explicitly, set it to current_locale.
// This might be a bit overzealous in assuming the language
// of the content, as a "single language" website might be expanded
// later on.
if(!$this->owner->ID && !$this->owner->Locale) {
// later on. See {@link requireDefaultRecords()} for batch setting
// of empty Locale columns on each dev/build call.
if(!$this->owner->Locale) {
$this->owner->Locale = Translatable::get_current_locale();
}