From e290c61047e298a0bc04759d2548ebaaaeefcbc8 Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Wed, 21 Aug 2024 10:29:09 +0200 Subject: [PATCH 1/4] Correctly created MaestroNotificationHandler --- .../src/Plugin/WebformHandler/MaestroNotificationHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/os2forms_forloeb/src/Plugin/WebformHandler/MaestroNotificationHandler.php b/modules/os2forms_forloeb/src/Plugin/WebformHandler/MaestroNotificationHandler.php index 69d7d9a..e4e5e91 100644 --- a/modules/os2forms_forloeb/src/Plugin/WebformHandler/MaestroNotificationHandler.php +++ b/modules/os2forms_forloeb/src/Plugin/WebformHandler/MaestroNotificationHandler.php @@ -49,7 +49,7 @@ final class MaestroNotificationHandler extends WebformHandlerBase { * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - $instance = new static($configuration, $plugin_id, $plugin_definition); + $instance = parent::create($container, $configuration, $plugin_id, $plugin_definition); $instance->loggerFactory = $container->get('logger.factory'); $instance->configFactory = $container->get('config.factory'); From d7b5b2ae872503c3469f183715b6db290c85847f Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Wed, 21 Aug 2024 10:38:39 +0200 Subject: [PATCH 2/4] Updated CHANGELOG --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7edbe9b..c43f6f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ before starting to add changes. Use example [placed in the end of the page](#exa ## [Unreleased] +## [3.15.8] 2024-08-21 + +- [#127](https://github.com/OS2Forms/os2forms/pull/127) + Correctly created MaestroNotificationHandler + ## [3.15.7] 2024-08-15 - [#123](https://github.com/OS2Forms/os2forms/pull/123) @@ -257,7 +262,8 @@ before starting to add changes. Use example [placed in the end of the page](#exa - Security in case of vulnerabilities. ``` -[Unreleased]: https://github.com/OS2Forms/os2forms/compare/3.15.7...HEAD +[Unreleased]: https://github.com/OS2Forms/os2forms/compare/3.15.8...HEAD +[3.15.8]: https://github.com/OS2Forms/os2forms/compare/3.15.7...3.15.8 [3.15.7]: https://github.com/OS2Forms/os2forms/compare/3.15.6...3.15.7 [3.15.6]: https://github.com/OS2Forms/os2forms/compare/3.15.5...3.15.6 [3.15.5]: https://github.com/OS2Forms/os2forms/compare/3.15.4...3.15.5 From 49c65516a63e2539078be68b8d6f8ccde95507ef Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Wed, 21 Aug 2024 13:21:29 +0200 Subject: [PATCH 3/4] Cleaned up object creation --- .../WebformHandler/WebformHandlerSF1601.php | 12 ++---------- .../MaestroNotificationHandler.php | 18 ------------------ 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/modules/os2forms_digital_post/src/Plugin/WebformHandler/WebformHandlerSF1601.php b/modules/os2forms_digital_post/src/Plugin/WebformHandler/WebformHandlerSF1601.php index 9da5717..ccb61a0 100644 --- a/modules/os2forms_digital_post/src/Plugin/WebformHandler/WebformHandlerSF1601.php +++ b/modules/os2forms_digital_post/src/Plugin/WebformHandler/WebformHandlerSF1601.php @@ -54,17 +54,9 @@ final class WebformHandlerSF1601 extends WebformHandlerBase { * @phpstan-param array $configuration */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - $instance = new static($configuration, $plugin_id, $plugin_definition); - - $instance->loggerFactory = $container->get('logger.factory'); - $instance->configFactory = $container->get('config.factory'); - $instance->renderer = $container->get('renderer'); - $instance->entityTypeManager = $container->get('entity_type.manager'); - $instance->conditionsValidator = $container->get('webform_submission.conditions_validator'); - $instance->tokenManager = $container->get('webform.token_manager'); - $instance->helper = $container->get(WebformHelperSF1601::class); + $instance = parent::create($container, $configuration, $plugin_id, $plugin_definition); - $instance->setConfiguration($configuration); + $instance->helper = $container->get(WebformHelperSF1601::class); return $instance; } diff --git a/modules/os2forms_forloeb/src/Plugin/WebformHandler/MaestroNotificationHandler.php b/modules/os2forms_forloeb/src/Plugin/WebformHandler/MaestroNotificationHandler.php index e4e5e91..156cc18 100644 --- a/modules/os2forms_forloeb/src/Plugin/WebformHandler/MaestroNotificationHandler.php +++ b/modules/os2forms_forloeb/src/Plugin/WebformHandler/MaestroNotificationHandler.php @@ -6,7 +6,6 @@ use Drupal\Core\Link; use Drupal\os2forms_forloeb\MaestroHelper; use Drupal\webform\Plugin\WebformHandlerBase; -use Symfony\Component\DependencyInjection\ContainerInterface; /** * Maestro notification handler. @@ -45,23 +44,6 @@ final class MaestroNotificationHandler extends WebformHandlerBase { */ private const NOTIFICATION_SUBJECT_MAX_LENGTH = 128; - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - $instance = parent::create($container, $configuration, $plugin_id, $plugin_definition); - - $instance->loggerFactory = $container->get('logger.factory'); - $instance->configFactory = $container->get('config.factory'); - $instance->renderer = $container->get('renderer'); - $instance->entityTypeManager = $container->get('entity_type.manager'); - $instance->conditionsValidator = $container->get('webform_submission.conditions_validator'); - - $instance->setConfiguration($configuration); - - return $instance; - } - /** * {@inheritdoc} */ From 7b986dfec39bbe594415a361ccc3ed29144045bc Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Mon, 26 Aug 2024 14:39:32 +0200 Subject: [PATCH 4/4] Updated CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c43f6f9..0a7585d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ before starting to add changes. Use example [placed in the end of the page](#exa ## [Unreleased] -## [3.15.8] 2024-08-21 +## [3.15.8] 2024-08-26 - [#127](https://github.com/OS2Forms/os2forms/pull/127) Correctly created MaestroNotificationHandler