Skip to content

Commit

Permalink
Merge pull request #1 from itk-dev/feature/os2form-audit-update
Browse files Browse the repository at this point in the history
ITKDev: Minor fixes
  • Loading branch information
cableman authored Oct 28, 2024
2 parents 876c756 + 827099d commit eb4d55b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion os2web_datalookup.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ description: 'Provides integration with Danish data lookup services such as Serv
package: 'OS2web'
core_version_requirement: ^8 || ^9 || ^10
dependencies:
- 'os2web/os2web_audit'
- 'os2web:os2web_audit'
4 changes: 2 additions & 2 deletions src/Plugin/os2web/DataLookup/DatafordelerPNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function submitConfigurationForm(array &$form, FormStateInterface $form_s
*/
public function lookup(string $param): CompanyLookupResult {
try {
$msg = sprintf('Hent produktionsenhed med PNummer: ', $param);
$msg = sprintf('Hent produktionsenhed med PNummer: %s', $param);
$this->auditLogger->info('DataLookup', $msg);
$response = $this->httpClient->get('hentProduktionsenhedMedPNummer', ['query' => ['ppNummer' => $param]]);
$result = json_decode((string) $response->getBody());
Expand Down Expand Up @@ -97,7 +97,7 @@ public function lookup(string $param): CompanyLookupResult {
$city = implode(' ', array_filter([
$address->CVRAdresse_postdistrikt ?? NULL,
$cvrResult->getPostalCode() ?? NULL,
]);
]));
$cvrResult->setCity($city);
$cvrResult->setMunicipalityCode($address->CVRAdresse_kommunekode ?? '');
$address = $cvrResult->getStreet() . ' ' . $cvrResult->getHouseNr() . ' ' . $cvrResult->getFloor() . $cvrResult->getApartmentNr();
Expand Down
10 changes: 8 additions & 2 deletions src/Plugin/os2web/DataLookup/ServiceplatformenBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Drupal\os2web_datalookup\Plugin\os2web\DataLookup;

use Drupal\Core\Form\FormStateInterface;
use Drupal\os2web_audit\Service\Logger;

/**
* Defines base plugin class for Serviceplatformen plugins.
Expand All @@ -26,8 +27,13 @@ abstract class ServiceplatformenBase extends DataLookupBase {
/**
* {@inheritdoc}
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
public function __construct(
array $configuration,
$plugin_id,
$plugin_definition,
Logger $auditLogger,
) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $auditLogger);
$this->init();
}

Expand Down

0 comments on commit eb4d55b

Please sign in to comment.