Skip to content

Commit

Permalink
Merge branch 'develop' into release/3.16.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jekuaitk authored Oct 31, 2024
2 parents cabde70 + 44e74c1 commit 6b5629e
Show file tree
Hide file tree
Showing 30 changed files with 64 additions and 319 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ before starting to add changes. Use example [placed in the end of the page](#exa

## [Unreleased]

- Applied coding standards
- [#192](https://github.com/OS2Forms/os2forms/pull/129)
Added audit logging module from os2web
- Remove dependency on webform migration module
- [#100](https://github.com/OS2Forms/os2forms/pull/100)
Removed unused `tecnickcom/tcpdf` package.

## [3.16.1] 2024-09-20

- [#133]https://github.com/OS2Forms/os2forms/pull/133
[OS-119] Keeping value of CPR clean, not adding address protection text

## [3.16.0] 2024-08-27
## [3.16.0-beta1] 2024-08-27

[#110](https://github.com/OS2Forms/os2forms/pull/110)

Expand Down Expand Up @@ -283,7 +290,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.8...HEAD
[Unreleased]: https://github.com/OS2Forms/os2forms/compare/3.16.0-beta1...HEAD
[3.16.0-beta1]: https://github.com/OS2Forms/os2forms/compare/3.15.8...3.16.0-beta1
[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
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
"drupal/webform": "^6.1",
"drupal/webform_composite": "^1.0@RC",
"drupal/webform_encrypt": "^2.0@alpha",
"drupal/webform_migrate": "^2.0@alpha",
"drupal/webform_node_element": "^1.2",
"drupal/webform_remote_handlers": "^3.0",
"drupal/webform_remote_select": "^1.0.6",
Expand All @@ -69,12 +68,12 @@
"http-interop/http-factory-guzzle": "^1.0.0",
"itk-dev/beskedfordeler-drupal": "^1.0",
"itk-dev/serviceplatformen": "^1.5",
"os2web/os2web_audit": "^0.1",
"os2web/os2web_datalookup": "^1.5",
"os2web/os2web_nemlogin": "^1.0",
"php-http/guzzle7-adapter": "^1.0",
"phpoffice/phpword": "^0.18.2",
"symfony/options-resolver": "^5.4 || ^6.0",
"tecnickcom/tcpdf": "~6",
"webmozart/path-util": "^2.3",
"wsdltophp/packagebase": "^5.0",
"zaporylie/composer-drupal-optimizations": "^1.2",
Expand Down Expand Up @@ -149,7 +148,8 @@
"phpstan/extension-installer": true,
"simplesamlphp/composer-module-installer": true,
"vaimo/composer-patches": true,
"zaporylie/composer-drupal-optimizations": true
"zaporylie/composer-drupal-optimizations": true,
"mglaman/composer-drupal-lenient": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function defineDefaultProperties() {
/**
* {@inheritdoc}
*/
public function prepare(array &$element, WebformSubmissionInterface $webform_submission = NULL) {
public function prepare(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) {
parent::prepare($element, $webform_submission);

if (isset($element['#webform_key'])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function getDefaultProperties() {
/**
* {@inheritdoc}
*/
public function prepare(array &$element, WebformSubmissionInterface $webform_submission = NULL) {
public function prepare(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) {
parent::prepare($element, $webform_submission);

$element['#autocomplete_route_parameters']['remove_place_name'] = $element['#remove_place_name'] ?? FALSE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function getDefaultProperties() {
/**
* {@inheritdoc}
*/
public function prepare(array &$element, WebformSubmissionInterface $webform_submission = NULL) {
public function prepare(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) {
parent::prepare($element, $webform_submission);

$element['#webform_composite_elements']['address']['#remove_place_name'] = TRUE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function getDefaultProperties() {
/**
* {@inheritdoc}
*/
public function prepare(array &$element, WebformSubmissionInterface $webform_submission = NULL) {
public function prepare(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) {
parent::prepare($element, $webform_submission);

$element['#autocomplete_route_name'] = 'os2forms_dawa.element.autocomplete';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function getDefaultProperties() {
/**
* {@inheritdoc}
*/
public function prepare(array &$element, WebformSubmissionInterface $webform_submission = NULL) {
public function prepare(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) {
parent::prepare($element, $webform_submission);

$element['#autocomplete_route_parameters']['remove_code'] = $element['#remove_code'] ?? FALSE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function getDefaultProperties() {
/**
* {@inheritdoc}
*/
public function prepare(array &$element, WebformSubmissionInterface $webform_submission = NULL) {
public function prepare(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) {
parent::prepare($element, $webform_submission);

$element['#autocomplete_route_parameters']['remove_code'] = $element['#remove_code'] ?? FALSE;
Expand Down
13 changes: 11 additions & 2 deletions modules/os2forms_digital_post/src/Helper/DigitalPostHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupInterfaceCompany;
use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupInterfaceCpr;
use Drupal\webform\WebformSubmissionInterface;
use ItkDev\Serviceplatformen\Service\SF1601\Serializer;
use ItkDev\Serviceplatformen\Service\SF1601\SF1601;
use ItkDev\Serviceplatformen\Service\SF1601\Serializer;
use Oio\Fjernprint\ForsendelseI;
use Psr\Log\LoggerInterface;
use Psr\Log\LoggerTrait;
Expand Down Expand Up @@ -55,7 +55,7 @@ public function __construct(
*
* @phpstan-return array<int, mixed>
*/
public function sendDigitalPost(string $type, Message $message, ?ForsendelseI $forsendelse, WebformSubmissionInterface $submission = NULL): array {
public function sendDigitalPost(string $type, Message $message, ?ForsendelseI $forsendelse, ?WebformSubmissionInterface $submission = NULL): array {
$senderSettings = $this->settings->getSender();
$options = [
'test_mode' => (bool) $this->settings->getTestMode(),
Expand All @@ -76,6 +76,15 @@ public function sendDigitalPost(string $type, Message $message, ?ForsendelseI $f

/**
* {@inheritdoc}
*
* @param mixed $level
* The level.
* @param string $message
* The message.
* @param array $context
* The context.
*
* @phpstan-param array<string, mixed> $context
*/
public function log($level, $message, array $context = []): void {
$this->logger->log($level, $message, $context);
Expand Down
2 changes: 1 addition & 1 deletion modules/os2forms_digital_post/src/Helper/MeMoHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
use Drupal\os2web_datalookup\LookupResult\CompanyLookupResult;
use Drupal\os2web_datalookup\LookupResult\CprLookupResult;
use Drupal\webform\WebformSubmissionInterface;
use ItkDev\Serviceplatformen\Service\SF1601\Serializer;
use ItkDev\Serviceplatformen\Service\SF1601\SF1601;
use ItkDev\Serviceplatformen\Service\SF1601\Serializer;

/**
* MeMo helper.
Expand Down
2 changes: 1 addition & 1 deletion modules/os2forms_digital_post/src/Helper/SF1461Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class SF1461Helper {
* See "BeskedFåTilsendt" on
* https://digitaliseringskataloget.dk/integration/sf1461.
*/
public function buildResponseDocument(int $statusCode, string $errorMessage = NULL): \DOMDocument {
public function buildResponseDocument(int $statusCode, ?string $errorMessage = NULL): \DOMDocument {
$xml = <<<'XML'
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:ModtagBeskedOutputType xmlns="urn:oio:sag-dok:3.0.0" xmlns:ns2="urn:oio:sts:1.0.0">
Expand Down
15 changes: 12 additions & 3 deletions modules/os2forms_digital_post/src/Helper/WebformHelperSF1601.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Drupal\os2forms_digital_post\Helper;

use Drupal\advancedqueue\Entity\QueueInterface;
use Drupal\advancedqueue\Job;
use Drupal\advancedqueue\JobResult;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Logger\LoggerChannelInterface;
use Drupal\advancedqueue\Entity\QueueInterface;
use Drupal\advancedqueue\Job;
use Drupal\advancedqueue\JobResult;
use Drupal\os2forms_digital_post\Exception\InvalidRecipientIdentifierElementException;
use Drupal\os2forms_digital_post\Exception\RuntimeException;
use Drupal\os2forms_digital_post\Exception\SubmissionNotFoundException;
Expand Down Expand Up @@ -199,6 +199,15 @@ private function loadQueue(): QueueInterface {

/**
* {@inheritdoc}
*
* @param mixed $level
* The level.
* @param string $message
* The message.
* @param array $context
* The context.
*
* @phpstan-param array<string, mixed> $context
*/
public function log($level, $message, array $context = []): void {
$this->logger->log($level, $message, $context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Drupal\os2forms_digital_post\Plugin\AdvancedQueue\JobType;

use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\advancedqueue\Job;
use Drupal\advancedqueue\JobResult;
use Drupal\advancedqueue\Plugin\AdvancedQueue\JobType\JobTypeBase;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\os2forms_digital_post\Helper\WebformHelperSF1601;
use Symfony\Component\DependencyInjection\ContainerInterface;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class WebformOs2FormsEncryptSubmissionStorage extends WebformEncryptSubmissionSt
*
* @see Drupal\webform\WebformSubmissionStorage::getColumns
*/
public function getColumns(WebformInterface $webform = NULL, EntityInterface $source_entity = NULL, AccountInterface $account = NULL, $include_elements = TRUE) {
public function getColumns(?WebformInterface $webform = NULL, ?EntityInterface $source_entity = NULL, ?AccountInterface $account = NULL, $include_elements = TRUE) {
if (!\Drupal::moduleHandler()->moduleExists('webform_revisions')) {
return parent::getColumns($webform, $source_entity, $account, $include_elements);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Drupal\os2forms_fbs_handler\Plugin\AdvancedQueue\JobType;

use Drupal\advancedqueue\Job;
use Drupal\advancedqueue\JobResult;
use Drupal\advancedqueue\Plugin\AdvancedQueue\JobType\JobTypeBase;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\Core\Logger\LoggerChannelInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\advancedqueue\Job;
use Drupal\advancedqueue\JobResult;
use Drupal\advancedqueue\Plugin\AdvancedQueue\JobType\JobTypeBase;
use Drupal\os2forms_fbs_handler\Client\FBS;
use Drupal\os2forms_fbs_handler\Client\Model\Guardian;
use Drupal\os2forms_fbs_handler\Client\Model\Patron;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace Drupal\os2forms_fbs_handler\Plugin\WebformHandler;

use Drupal\advancedqueue\Entity\Queue;
use Drupal\advancedqueue\Job;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\Core\Logger\LoggerChannelInterface;
use Drupal\Core\Render\RendererInterface;
use Drupal\advancedqueue\Entity\Queue;
use Drupal\advancedqueue\Job;
use Drupal\os2forms_fbs_handler\Plugin\AdvancedQueue\JobType\FbsCreateUser;
use Drupal\webform\Plugin\WebformHandlerBase;
use Drupal\webform\WebformSubmissionConditionsValidatorInterface;
Expand Down
1 change: 1 addition & 0 deletions modules/os2forms_forloeb/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ before starting to add changes.

## [Unreleased]

- Remove dependency on webform_migrate module
- Implemented `hook_maestro_zero_user_notification` and added *Maestro
notification* handler for sending notifications via email or digital post.
- Cleaned up prefilling of forms in `MaestroWebformInheritTask`.
Expand Down
1 change: 0 additions & 1 deletion modules/os2forms_forloeb/os2forms_forloeb.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ dependencies:
- 'drupal:webform_composite'
- 'drupal:webform_entity_print'
- 'drupal:webform_entity_print_attachment'
- 'drupal:webform_migrate'
- 'drupal:webform_node_element'
- 'drupal:webform_remote_handlers'
- 'drupal:webform_rest'
Expand Down
8 changes: 4 additions & 4 deletions modules/os2forms_forloeb/src/MaestroHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

use DigitalPost\MeMo\Action;
use DigitalPost\MeMo\EntryPoint;
use Drupal\advancedqueue\Entity\QueueInterface;
use Drupal\advancedqueue\Job;
use Drupal\advancedqueue\JobResult;
use Drupal\Component\Render\MarkupInterface;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Config\ConfigFactoryInterface;
Expand All @@ -19,6 +16,9 @@
use Drupal\Core\Render\Markup;
use Drupal\Core\Site\Settings;
use Drupal\Core\Url;
use Drupal\advancedqueue\Entity\QueueInterface;
use Drupal\advancedqueue\Job;
use Drupal\advancedqueue\JobResult;
use Drupal\entity_print\Plugin\EntityPrintPluginManagerInterface;
use Drupal\maestro\Engine\MaestroEngine;
use Drupal\maestro\Utility\TaskHandler;
Expand Down Expand Up @@ -456,7 +456,7 @@ private function sendNotificationDigitalPost(
*
* @see self::renderHtml()
*/
public function renderNotification(WebformSubmissionInterface $submission, string $handlerId, string $notificationType, array $templateTask, int $maestroQueueID, string $contentType = NULL): array {
public function renderNotification(WebformSubmissionInterface $submission, string $handlerId, string $notificationType, array $templateTask, int $maestroQueueID, ?string $contentType = NULL): array {
$handler = $submission->getWebform()->getHandler($handlerId);
$settings = $handler->getSettings();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Drupal\os2forms_forloeb\Plugin\AdvancedQueue\JobType;

use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\advancedqueue\Job;
use Drupal\advancedqueue\JobResult;
use Drupal\advancedqueue\Plugin\AdvancedQueue\JobType\JobTypeBase;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\os2forms_forloeb\MaestroHelper;
use Symfony\Component\DependencyInjection\ContainerInterface;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class MaestroWebformInheritTask extends MaestroWebformTask {
* [1] - is the queue ID
* The processID and queueID properties are defined in the MaestroTaskTrait.
*/
public function __construct(array $configuration = NULL) {
public function __construct(?array $configuration = NULL) {
if (is_array($configuration)) {
$this->processID = $configuration[0];
$this->queueID = $configuration[1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class MaestroWebformMultipleTask extends MaestroWebformTask {
* [1] - is the queue ID
* The processID and queueID properties are defined in the MaestroTaskTrait.
*/
public function __construct(array $configuration = NULL) {
public function __construct(?array $configuration = NULL) {
if (is_array($configuration)) {
$this->processID = $configuration[0];
$this->queueID = $configuration[1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function getElementSelectorSourceValues(array $element) {
/**
* {@inheritdoc}
*/
public function prepare(array &$element, WebformSubmissionInterface $webform_submission = NULL) {
public function prepare(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) {
// Setting empty options to avoid errors during load.
$element['#options'] = [];
parent::prepare($element, $webform_submission);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function getElementSelectorSourceValues(array $element) {
/**
* {@inheritdoc}
*/
public function prepare(array &$element, WebformSubmissionInterface $webform_submission = NULL) {
public function prepare(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) {
// Setting empty options to avoid errors during load.
$element['#options'] = [];
parent::prepare($element, $webform_submission);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function getTranslatableProperties() {
/**
* {@inheritdoc}
*/
public function prepare(array &$element, WebformSubmissionInterface $webform_submission = NULL) {
public function prepare(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) {
parent::prepare($element, $webform_submission);

$element['#attributes']['class'][] = 'nemlogin-button-link';
Expand Down
2 changes: 1 addition & 1 deletion modules/os2forms_permissions_by_term/src/Helper/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public function fieldWidgetWebformEntityReferenceFormAlter(array &$elements) {
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/
private function filterWebformSelectOptions(array $options, array &$result = [], string $parent = NULL) {
private function filterWebformSelectOptions(array $options, array &$result = [], ?string $parent = NULL) {
foreach ($options as $key => $option) {
if ($option instanceof FieldFilteredMarkup) {
$webform = $this->entityTypeManager->getStorage('webform')->load($key);
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion os2forms.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ dependencies:
- 'drupal:webform_composite'
- 'drupal:webform_entity_print'
- 'drupal:webform_entity_print_attachment'
- 'drupal:webform_migrate'
- 'drupal:webform_scheduled_email'
- 'drupal:webform_submission_export_import'
- 'drupal:webform_submission_log'
Expand Down
Loading

0 comments on commit 6b5629e

Please sign in to comment.