mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
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:
parent
ba32a53c79
commit
232c187850
@ -1495,7 +1495,7 @@ class Translatable extends DataExtension implements PermissionProvider {
|
|||||||
foreach ($langlist as $langCode) {
|
foreach ($langlist as $langCode) {
|
||||||
if($langCode && isset($allCodes[$langCode])) {
|
if($langCode && isset($allCodes[$langCode])) {
|
||||||
if(is_array($allCodes[$langCode])) {
|
if(is_array($allCodes[$langCode])) {
|
||||||
$returnMap[$langCode] = $allCodes[$langCode][0];
|
$returnMap[$langCode] = $allCodes[$langCode]['name'];
|
||||||
} else {
|
} else {
|
||||||
$returnMap[$langCode] = $allCodes[$langCode];
|
$returnMap[$langCode] = $allCodes[$langCode];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user