Skip to content

Conversation

rimi-itk
Copy link
Contributor

@rimi-itk rimi-itk commented Aug 29, 2025

Description

Handles #23

When performing a CPR lookup, the lookup can be succesful even when the CPR contains non-numeric characters, e.g. looking up 261174-0000 will return the same result as when looking up “2611740000 (or 261174💩0000). (The CPR lookup service complains if a non-numeric CPR is provided.)

However, the returned lookup result does not contain the actual identifier (CPR or CVR), but the identifier used to perform the lookup. This can lead to issues when using the lookup result to send digital post or call other services expecting a clean CPR/CPR, i.e. an identifier containing only decimal digits.

This code in this pull request sets the identifier from the actual lookup on the result, in effect sanitizing the identifier on the result.

The service used by src/Plugin/os2web/DataLookup/ServiceplatformenCPR.php is deprecated so no changes are made there (apart from adding a @TODO annotation).

Checklist

  • My code passes our static analysis suite.
  • My code passes our continuous integration process.

Important

The failing actions are not related to changes in this pull request and must be addressed in a separate pull request.

@rimi-itk rimi-itk marked this pull request as ready for review August 29, 2025 08:31
@rimi-itk rimi-itk requested a review from jekuaitk August 29, 2025 08:32
Copy link
Contributor

@jekuaitk jekuaitk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@rimi-itk rimi-itk force-pushed the hotfix/lookup-identifier branch from 3581345 to d9685de Compare September 1, 2025 12:03
@jekuaitk jekuaitk merged commit bcd6e0f into OS2web:2.x Sep 1, 2025
1 of 4 checks passed
@jekuaitk jekuaitk deleted the hotfix/lookup-identifier branch September 1, 2025 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants