Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 3bd1a1d

Browse files
authored
Merge pull request #44 from itk-dev/feature/SUPP0RT-1145-allow-os2forms-attachment-element
Feature/supp0rt 1145 allow os2forms attachment element
2 parents 97c275e + 48516f8 commit 3bd1a1d

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ Versioning](https://semver.org/spec/v2.0.0.html).
99

1010
## [Unreleased]
1111

12+
## [2.0.1]
13+
14+
## Changed
15+
16+
- Updated allowed attachment elements to contain `os2forms_attachment`
17+
1218
## [2.0.0]
1319

1420
### Changed
@@ -61,7 +67,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
6167
“KombiPostAfsend”](https://digitaliseringskataloget.dk/integration/sf1601).
6268
- Added GitHub Actions for coding standards checks and code analysis.
6369

64-
[Unreleased]: https://github.com/itk-dev/os2forms_digital_post/compare/2.0.0...HEAD
70+
[Unreleased]: https://github.com/itk-dev/os2forms_digital_post/compare/2.0.1...HEAD
71+
[2.0.1]: https://github.com/itk-dev/os2forms_digital_post/compare/2.0.0...2.0.1
6572
[2.0.0]: https://github.com/itk-dev/os2forms_digital_post/compare/1.2.3...2.0.0
6673
[1.2.3]: https://github.com/itk-dev/os2forms_digital_post/compare/1.2.2...1.2.3
6774
[1.2.2]: https://github.com/itk-dev/os2forms_digital_post/compare/1.2.0...1.2.2

src/Plugin/WebformHandler/WebformHandlerSF1601.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,14 @@ static function (array $element) use ($elementTypes) {
270270
private function getAttachmentElements(): array {
271271
$elements = $this->getWebform()->getElementsDecodedAndFlattened();
272272

273+
$elementTypes = [
274+
'webform_entity_print_attachment:pdf',
275+
'os2forms_attachment',
276+
];
273277
$elements = array_filter(
274278
$elements,
275-
static function (array $element) {
276-
return preg_match('/^webform_entity_print_attachment:(pdf)$/', $element['#type'] ?? NULL);
279+
static function (array $element) use ($elementTypes) {
280+
return in_array($element['#type'], $elementTypes, TRUE);
277281
}
278282
);
279283

0 commit comments

Comments
 (0)