From 17b9a5d9bd1c60d79a0c36bee50406fc65bbb51b Mon Sep 17 00:00:00 2001 From: cam-findlay Date: Thu, 28 Mar 2013 15:07:09 +1300 Subject: [PATCH] merged $allCodes returns items with nested array items from the common_locales in line 1493 return nested array of "name"=>LangName,"native"=>NativeName. need to make sure to pull the "name" parameter from the array for the $returnMap. Otherwise was returning: [Notice] Undefined offset: 0 --- code/model/Translatable.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/model/Translatable.php b/code/model/Translatable.php index 577706f..6ef415f 100755 --- a/code/model/Translatable.php +++ b/code/model/Translatable.php @@ -1495,7 +1495,7 @@ class Translatable extends DataExtension implements PermissionProvider { foreach ($langlist as $langCode) { if($langCode && isset($allCodes[$langCode])) { if(is_array($allCodes[$langCode])) { - $returnMap[$langCode] = $allCodes[$langCode][0]; + $returnMap[$langCode] = $allCodes[$langCode]['name']; } else { $returnMap[$langCode] = $allCodes[$langCode]; } @@ -1763,4 +1763,4 @@ class Translatable_Transformation extends FormTransformation { return $nonEditableField_holder; } -} \ No newline at end of file +}