Skip to content

Commit 0bec3b0

Browse files
authored
Merge pull request #18 from itk-dev/fix/nemid-company-city-adjustment
Avoid CVR city containing postal code if city is found
2 parents dcfabd8 + 28e5a6c commit 0bec3b0

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
* Ensure postal code is only added to city if `CVRAdresse_postdistrikt` is not set.
1011
* Added missing use statement to fix issue on datafordeler settings pages
1112
`pnumber_lookup`, `cvr_lookup` and `cpr_lookup`.
1213

src/Plugin/os2web/DataLookup/DatafordelerCVR.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,7 @@ public function lookup(string $param): CompanyLookupResult {
9494
$cvrResult->setFloor($address->CVRAdresse_etagebetegnelse ?? '');
9595
$cvrResult->setApartmentNr($address->CVRAdresse_doerbetegnelse ?? '');
9696
$cvrResult->setPostalCode($address->CVRAdresse_postnummer ?? '');
97-
$city = implode(' ', array_filter([
98-
$address->CVRAdresse_postdistrikt ?? NULL,
99-
$cvrResult->getPostalCode() ?? NULL,
100-
]));
97+
$city = $address->CVRAdresse_postdistrikt ?? $cvrResult->getPostalCode();
10198
$cvrResult->setCity($city);
10299
$cvrResult->setMunicipalityCode($address->CVRAdresse_kommunekode ?? '');
103100

0 commit comments

Comments
 (0)