Permalink
Browse files

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
  • Loading branch information...
1 parent ba32a53 commit 232c187850e182de43111b6b32004df3f6a60dd4 @camfindlay camfindlay committed with chillu Mar 28, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 code/model/Translatable.php
@@ -1495,7 +1495,7 @@ static function get_existing_content_languages($className = 'SiteTree', $where =
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 @@ protected function baseTransform($nonEditableField, $originalField) {
return $nonEditableField_holder;
}
-}
+}

0 comments on commit 232c187

Please sign in to comment.