Incompatibility with commerceguys/addressing

Created on 11 November 2024, 4 days ago

Found that in CommerceGuys\Addressing\Subdivision\SubdivisionRepository.php

public function getList(array $parents, string $locale = null): array
{
$definitions = $this->loadDefinitions($parents);
if (empty($definitions)) {
return [];
}
$definitionLocale = $definitions['locale'] ?? '';
$useLocalName = Locale::matchCandidates($locale, $definitionLocale);
$list = [];
foreach ($definitions['subdivisions'] as $id => $definition) {
$list[$id] = $useLocalName ? $definition['local_name'] : $definition['name'];
}

return $list;
}

Problem:
If the config has the key 'locale' and the current interface lang code is the same, then the $definition['local_name'] is undefined.

Solution:
Here are 2 ways, or delete from definitions the 'locale', or add the 'local_name' to all subdivisions in config.

💬 Support request
Status

Needs review

Version

1.0

Component

Code

Created by

🇲🇩Moldova nick.murza Moldova

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024