Skip to content

Commit

Permalink
Made digital post module optional
Browse files Browse the repository at this point in the history
  • Loading branch information
rimi-itk committed Sep 25, 2023
1 parent 961966c commit 6f0fa15
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,16 @@
"drupal/webform_validation": "^2.0",
"drupal/webform_views": "^5.0@alpha",
"drupal/workflow_participants": "^2.4",
"os2forms/os2forms_digital_post": "^3.0",
"os2web/os2web_datalookup": "^1.0",
"os2web/os2web_nemlogin": "^1.0",
"phpoffice/phpword": "^0.18.2",
"tecnickcom/tcpdf": "~6",
"webmozart/path-util": "^2.3",
"zaporylie/composer-drupal-optimizations": "^1.2"
},
"suggest": {
"os2forms/os2forms_digital_post": "Send Maestro notifications via digital post (see https://github.com/itk-dev/os2forms_digital_post/blob/main/README.md)"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"drupal/coder": "^8.3",
Expand Down
4 changes: 3 additions & 1 deletion modules/os2forms_forloeb/os2forms_forloeb.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ dependencies:
- 'drupal:webform_submission_log'
- 'drupal:webform_templates'
- 'drupal:workflow_participants'
- 'os2forms_digital_post:os2forms_digital_post'
# os2forms_digital_post may be used for sending Meastro notifications via digital post
# - 'os2forms_digital_post:os2forms_digital_post'

'interface translation project': os2forms_forloeb
'interface translation server pattern': modules/contrib/os2forms_forloeb/translations/os2forms_forloeb.da.po
1 change: 0 additions & 1 deletion modules/os2forms_forloeb/os2forms_forloeb.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ services:
- '@logger.channel.os2forms_forloeb_submission'
- '@module_handler'
- '@plugin.manager.entity_print.print_engine'
- '@Drupal\os2forms_digital_post\Helper\DigitalPostHelper'
5 changes: 2 additions & 3 deletions modules/os2forms_forloeb/src/MaestroHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public function __construct(
readonly private LoggerChannelInterface $submissionLogger,
readonly private ModuleHandlerInterface $moduleHandler,
readonly private EntityPrintPluginManagerInterface $entityPrintPluginManager,
readonly private DigitalPostHelper $digitalPostHelper
) {
$this->config = $configFactory->get(SettingsForm::SETTINGS);
$this->webformSubmissionStorage = $entityTypeManager->getStorage('webform_submission');
Expand Down Expand Up @@ -342,8 +341,8 @@ private function sendNotificationDigitalPost(
WebformSubmissionInterface $submission,
string $notificationType
): void {
if (!$this->moduleHandler->moduleExists('os2forms_digital_post')) {
throw new RuntimeException('Cannot send digital post. Module os2forms_digital_post not installed.');
if (NULL === $this->digitalPostHelper) {
throw new RuntimeException('Cannot send digital post. Module OS2Forms Digital Post (os2forms_digital_post) not installed.');
}

try {
Expand Down

0 comments on commit 6f0fa15

Please sign in to comment.