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
This commit is contained in:
cam-findlay 2013-03-28 15:07:09 +13:00 committed by Ingo Schommer
parent ba32a53c79
commit 232c187850

View File

@ -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];
}