From 658cac4df6144a117b12e9939b261fb5053ceac9 Mon Sep 17 00:00:00 2001 From: Sebastian Mares Date: Sun, 12 Feb 2012 21:58:28 +0100 Subject: [PATCH] Copy values to keys in updateCMSFields' $alreadyTranslatedLocales since it's later used by LanguageDropdownField to exclude languages for which a translation already exists and LanguageDropdownField operates on array keys. Also removed unused index/key variable $i from foreach loop that displays the existing translations. --- code/model/Translatable.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/model/Translatable.php b/code/model/Translatable.php index 4a7784f..beaa2ed 100755 --- a/code/model/Translatable.php +++ b/code/model/Translatable.php @@ -945,6 +945,7 @@ class Translatable extends DataExtension implements PermissionProvider { // and a translation. Include the current locale (record might not be saved yet). $alreadyTranslatedLocales = $this->getTranslatedLocales(); $alreadyTranslatedLocales[$this->owner->Locale] = $this->owner->Locale; + $alreadyTranslatedLocales = array_combine($alreadyTranslatedLocales, $alreadyTranslatedLocales); if($originalRecord && $isTranslationMode) { $originalLangID = Session::get($this->owner->ID . '_originalLangID'); @@ -1009,7 +1010,7 @@ class Translatable extends DataExtension implements PermissionProvider { new HeaderField('ExistingTransHeader', _t('Translatable.EXISTING', 'Existing translations:'), 3) ); $existingTransHTML = '