Skip to content

Commit ffecec3

Browse files
committed
5189: Cleaned up
1 parent c7762ba commit ffecec3

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

CHANGELOG.md

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

1212
## [Unreleased]
1313

14+
- [PR-189](https://github.com/OS2Forms/os2forms/pull/189)
15+
- Added support for MeMo 1.2 and added additional validation of MeMo actions.
16+
1417
## [4.1.0] 2025-06-03
1518

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

modules/os2forms_digital_post/src/Helper/MeMoHelper.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ private function buildAction(array $options, WebformSubmissionInterface $submiss
199199
*
200200
* @return \Drupal\Core\StringTranslation\TranslatableMarkup|null
201201
* A message if the URL is not valid for an action.
202+
*
203+
* @phpstan-param array<string, mixed> $options
202204
*/
203205
public static function validateActionUrl(string $url, array $options): ?TranslatableMarkup {
204206
// URL must be absolute and use https (cf. https://digitaliser.dk/digital-post/nyhedsarkiv/2024/nov/oeget-validering-i-digital-post)
@@ -214,6 +216,8 @@ public static function validateActionUrl(string $url, array $options): ?Translat
214216
'%action' => self::getTranslatedActionName($options['action']),
215217
]);
216218
}
219+
220+
return NULL;
217221
}
218222

219223
/**
@@ -227,6 +231,9 @@ public static function validateActionUrl(string $url, array $options): ?Translat
227231

228232
/**
229233
* Get translated action names.
234+
*
235+
* @return array<string, string>
236+
* The translated action names.
230237
*/
231238
public static function getTranslatedActionNames(): array {
232239
if (NULL === self::$translatedActionNames) {

modules/os2forms_digital_post/src/Plugin/WebformHandler/WebformHandlerSF1601.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ public function validateConfigurationForm(array &$form, FormStateInterface $form
265265
$formState->setErrorByName(
266266
self::MEMO_ACTIONS . '][actions][' . $index . '][url',
267267
$this->t('Url for action %action is required.', [
268-
'%action' => $this->getTranslatedActionName($action['action']),
268+
'%action' => MeMoHelper::etTranslatedActionName($action['action']),
269269
])
270270
);
271271
}

0 commit comments

Comments
 (0)