Skip to content
Snippets Groups Projects
Commit bdafdf15 authored by Christophe Goffin's avatar Christophe Goffin Committed by BramDriesen
Browse files

Issue #3298269: Error in PostalCodeHelper::getPostalCodeByMunicipality

parent be43abed
No related branches found
No related tags found
1 merge request!2Issue #3298269: Error in PostalCodeHelper::getPostalCodeByMunicipality
......@@ -73,17 +73,14 @@ class PostalCodeHelper implements PostalCodeHelperInterface {
* {@inheritdoc}
*/
public function getPostalCodeByMunicipality(string $municipality): ?TermInterface {
$term_ids = $this->entityTypeManager
$terms = $this->entityTypeManager
->getStorage('taxonomy_term')
->loadByProperties([
'name' => $municipality,
'vid' => 'belgian_postal_code',
]);
if ($term_ids) {
$terms = $this->entityTypeManager
->getStorage('taxonomy_term')
->loadMultiple($term_ids);
if ($terms) {
return reset($terms);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment