Skip to content

Commit bcae0ad

Browse files
committed
#186: Update CHANGELOG and apply coding standards
1 parent c32cd88 commit bcae0ad

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ before starting to add changes. Use example [placed in the end of the page](#exa
1111

1212
## [Unreleased]
1313

14+
- Avoid double-saving submissions when handling name and address protection.
15+
1416
## [4.1.0] 2025-06-03
1517

1618
- [PR-176](https://github.com/OS2Forms/os2forms/pull/176)

modules/os2forms_nemid/src/Plugin/WebformElement/NemidAddress.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@ public function alterForm(array &$element, array &$form, FormStateInterface $for
4747
// Only manipulate element on submission create form.
4848
if (!$webformSubmission->isCompleted()) {
4949
if ($cprLookupResult && $cprLookupResult->isNameAddressProtected()) {
50-
// TODO: What is this used for?
50+
// @todo What is this used for?
5151
$element['#info_message'] = 'adresse beskyttelse';
5252
NestedArray::setValue($form['elements'], $element['#webform_parents'], $element);
5353

54-
// It is important that the 'os2forms_nemid_submission_set_address_protected' submit action is executed before the 'save' action.
55-
// Otherwise, submissions are both created and completed, resulting in unexpected behavior, e.g., handlers being run twice.
54+
// It is important the 'os2forms_nemid_submission_set_address_protected'
55+
// submit action is executed before the 'save' action. Otherwise,
56+
// submissions are both created and completed, resulting in unexpected
57+
// behavior, e.g., handlers being run twice.
5658
if (isset($form['actions']['submit']['#submit']) && is_array($form['actions']['submit']['#submit'])) {
5759
array_unshift($form['actions']['submit']['#submit'], 'os2forms_nemid_submission_set_address_protected');
5860
}

0 commit comments

Comments
 (0)