Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [3.0.1]

### Fixed

- Fixed issue with wrong service being injected.
[PR-50](https://github.com/itk-dev/os2forms_digital_post/pull/50)

## [3.0.0]

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

[Unreleased]: https://github.com/itk-dev/os2forms_digital_post/compare/3.0.0...HEAD
[Unreleased]: https://github.com/itk-dev/os2forms_digital_post/compare/3.0.1...HEAD
[3.0.1]: https://github.com/itk-dev/os2forms_digital_post/compare/3.0.0...3.0.1
[3.0.0]: https://github.com/itk-dev/os2forms_digital_post/compare/2.0.2...3.0.0
[2.0.2]: https://github.com/itk-dev/os2forms_digital_post/compare/2.0.1...2.0.2
[2.0.1]: https://github.com/itk-dev/os2forms_digital_post/compare/2.0.0...2.0.1
Expand Down
4 changes: 2 additions & 2 deletions os2forms_digital_post.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ services:
Drupal\os2forms_digital_post\Helper\MeMoHelper:
arguments:
- "@Drupal\\os2forms_digital_post\\Helper\\Settings"
- "@plugin.manager.webform.element"
- "@plugin.manager.element_info"
- "@webform.token_manager"

Drupal\os2forms_digital_post\Helper\ForsendelseHelper:
arguments:
- "@Drupal\\os2forms_digital_post\\Helper\\Settings"
- "@plugin.manager.webform.element"
- "@plugin.manager.element_info"
- "@webform.token_manager"

Drupal\os2forms_digital_post\Helper\DigitalPostHelper:
Expand Down
5 changes: 3 additions & 2 deletions src/Helper/AbstractMessageHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace Drupal\os2forms_digital_post\Helper;

use DigitalPost\MeMo\Message;
use Drupal\Core\Render\ElementInfoManager;
use Drupal\os2forms_digital_post\Exception\InvalidAttachmentElementException;
use Drupal\os2forms_digital_post\Model\Document;
use Drupal\os2forms_digital_post\Plugin\WebformHandler\WebformHandlerSF1601;
use Drupal\webform\Plugin\WebformElementManagerInterface;
use Drupal\webform\WebformSubmissionInterface;
use Drupal\webform\WebformTokenManagerInterface;
use Drupal\webform_attachment\Element\WebformAttachmentBase;
Expand All @@ -23,7 +23,7 @@ abstract class AbstractMessageHelper {
*/
public function __construct(
readonly protected Settings $settings,
readonly protected WebformElementManagerInterface $elementInfoManager,
readonly protected ElementInfoManager $elementInfoManager,
readonly protected WebformTokenManagerInterface $webformTokenManager
) {
}
Expand All @@ -42,6 +42,7 @@ protected function getMainDocument(WebformSubmissionInterface $submission, array
$element = $submission->getWebform()->getElement($element) ?: [];
[$type] = explode(':', $element['#type']);
$instance = $this->elementInfoManager->createInstance($type);

if (!$instance instanceof WebformAttachmentBase) {
throw new InvalidAttachmentElementException(sprintf('Attachment element must be an instance of %s. Found %s.', WebformAttachmentBase::class, get_class($instance)));
}
Expand Down