Set actual identifier from lookup on lookup result #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
(or261174💩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
Important
The failing actions are not related to changes in this pull request and must be addressed in a separate pull request.