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

Commit cc54f3b

Browse files
authored
Merge pull request #50 from itk-dev/feature/create-element-instance
FORDRIF-175: Fixes
2 parents 9bb0f05 + 730aa46 commit cc54f3b

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

CHANGELOG.md

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

1010
## [Unreleased]
1111

12+
## [3.0.1]
13+
14+
### Fixed
15+
16+
- Fixed issue with wrong service being injected.
17+
[PR-50](https://github.com/itk-dev/os2forms_digital_post/pull/50)
18+
1219
## [3.0.0]
1320

1421
### Added
@@ -96,7 +103,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
96103
“KombiPostAfsend”](https://digitaliseringskataloget.dk/integration/sf1601).
97104
- Added GitHub Actions for coding standards checks and code analysis.
98105

99-
[Unreleased]: https://github.com/itk-dev/os2forms_digital_post/compare/3.0.0...HEAD
106+
[Unreleased]: https://github.com/itk-dev/os2forms_digital_post/compare/3.0.1...HEAD
107+
[3.0.1]: https://github.com/itk-dev/os2forms_digital_post/compare/3.0.0...3.0.1
100108
[3.0.0]: https://github.com/itk-dev/os2forms_digital_post/compare/2.0.2...3.0.0
101109
[2.0.2]: https://github.com/itk-dev/os2forms_digital_post/compare/2.0.1...2.0.2
102110
[2.0.1]: https://github.com/itk-dev/os2forms_digital_post/compare/2.0.0...2.0.1

os2forms_digital_post.services.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ services:
1818
Drupal\os2forms_digital_post\Helper\MeMoHelper:
1919
arguments:
2020
- "@Drupal\\os2forms_digital_post\\Helper\\Settings"
21-
- "@plugin.manager.webform.element"
21+
- "@plugin.manager.element_info"
2222
- "@webform.token_manager"
2323

2424
Drupal\os2forms_digital_post\Helper\ForsendelseHelper:
2525
arguments:
2626
- "@Drupal\\os2forms_digital_post\\Helper\\Settings"
27-
- "@plugin.manager.webform.element"
27+
- "@plugin.manager.element_info"
2828
- "@webform.token_manager"
2929

3030
Drupal\os2forms_digital_post\Helper\DigitalPostHelper:

src/Helper/AbstractMessageHelper.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
namespace Drupal\os2forms_digital_post\Helper;
44

55
use DigitalPost\MeMo\Message;
6+
use Drupal\Core\Render\ElementInfoManager;
67
use Drupal\os2forms_digital_post\Exception\InvalidAttachmentElementException;
78
use Drupal\os2forms_digital_post\Model\Document;
89
use Drupal\os2forms_digital_post\Plugin\WebformHandler\WebformHandlerSF1601;
9-
use Drupal\webform\Plugin\WebformElementManagerInterface;
1010
use Drupal\webform\WebformSubmissionInterface;
1111
use Drupal\webform\WebformTokenManagerInterface;
1212
use Drupal\webform_attachment\Element\WebformAttachmentBase;
@@ -23,7 +23,7 @@ abstract class AbstractMessageHelper {
2323
*/
2424
public function __construct(
2525
readonly protected Settings $settings,
26-
readonly protected WebformElementManagerInterface $elementInfoManager,
26+
readonly protected ElementInfoManager $elementInfoManager,
2727
readonly protected WebformTokenManagerInterface $webformTokenManager
2828
) {
2929
}
@@ -42,6 +42,7 @@ protected function getMainDocument(WebformSubmissionInterface $submission, array
4242
$element = $submission->getWebform()->getElement($element) ?: [];
4343
[$type] = explode(':', $element['#type']);
4444
$instance = $this->elementInfoManager->createInstance($type);
45+
4546
if (!$instance instanceof WebformAttachmentBase) {
4647
throw new InvalidAttachmentElementException(sprintf('Attachment element must be an instance of %s. Found %s.', WebformAttachmentBase::class, get_class($instance)));
4748
}

0 commit comments

Comments
 (0)