Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
de9a7a1
Added “Display on“ options to Map element
rimi-itk Mar 11, 2026
7c5e04e
Added documentation on fetching GeoJSON using the API
rimi-itk Mar 11, 2026
ff515e3
Updated changelog
rimi-itk Mar 11, 2026
3c9dffb
Handled "mail" display
rimi-itk Mar 11, 2026
31f4ca5
Updated URL
rimi-itk Mar 12, 2026
fcbd689
Merge branch 'develop' into feature/maps-element-display
jekuaitk Mar 23, 2026
333faf1
Merge branch 'develop' into feature/maps-element-display
jekuaitk Mar 23, 2026
c096da5
Merge branch 'develop' into feature/maps-element-display
jekuaitk Apr 13, 2026
4a88b16
Added first, middle and last name webform elements
jekuaitk May 1, 2026
15062f6
Update CHANGELOG
jekuaitk May 1, 2026
09f9b1a
Move digital signature confgurations to handler
jekuaitk May 18, 2026
dc55487
Merge branch 'develop' into feature/move-digital-signature-configurat…
jekuaitk May 18, 2026
2bf2ec6
Adding 5.1.0 version
stankut Jun 3, 2026
e4a5e90
Merge pull request #330 from OS2Forms/release/5.1.0
stankut Jun 3, 2026
4901afb
Merge branch 'develop' into feature/maps-element-display
jekuaitk Jun 9, 2026
81d7c5e
Merge branch 'develop' into feature/maps-element-display
jekuaitk Jun 23, 2026
70fe8d3
Allow configurating on which submission states handlers should run
jekuaitk Jun 23, 2026
48d8307
Updated CHANGELOG
jekuaitk Jun 23, 2026
06fdf29
336: Avoided inheriting data on page transition
jekuaitk Jun 26, 2026
badc51f
336: Updated CHANGELOG
jekuaitk Jun 26, 2026
e001388
Merge branch 'develop' into feature/add-first-middle-and-last-name-ne…
jekuaitk Jun 26, 2026
f1217ec
Updated CHANGELOG
jekuaitk Jul 2, 2026
a335a56
Merge branch 'develop' into feature/move-digital-signature-configurat…
jekuaitk Jul 20, 2026
ee0a2a2
Ensured signed documents are fetched when getting file content
jekuaitk Jul 20, 2026
8c9e4b3
Mimic original behaviour when migrating
jekuaitk Jul 20, 2026
e1abc9d
Ensured only os2forms_digital_signature_document and os2forms_attachm…
jekuaitk Jul 20, 2026
f45f900
Added batching to the migration
jekuaitk Jul 20, 2026
1a33e29
Merge remote-tracking branch 'origin/feature/maps-element-display' in…
jekuaitk Aug 27, 2026
4109071
Merge remote-tracking branch 'origin/fix/336-avoid-inheriting-data-on…
jekuaitk Aug 27, 2026
1d9b6d3
Merge remote-tracking branch 'origin/feature/add-first-middle-and-las…
jekuaitk Aug 27, 2026
3252935
Updated CHANGELOG
jekuaitk Aug 27, 2026
093d173
Added build script
jekuaitk Aug 27, 2026
8054008
Dev required os2web_datalookup with nemid elements data
jekuaitk Aug 28, 2026
05aceb5
Ignored advisories
jekuaitk Aug 28, 2026
5b76663
Normalized composer
jekuaitk Aug 28, 2026
e9bed7d
Merge remote-tracking branch 'origin/feature/add-states-configuration…
jekuaitk Aug 31, 2026
ef1e81b
Merge remote-tracking branch 'origin/feature/move-digital-signature-c…
jekuaitk Aug 31, 2026
00a4e6a
Updated CHANGELOG
jekuaitk Aug 31, 2026
5a1441b
Update build_release script
jekuaitk Aug 31, 2026
5038fc6
Fix dublicated update hook name
jekuaitk Aug 31, 2026
84b3506
Fixed further merge conflicts
jekuaitk Sep 1, 2026
931725e
Reverted handler states from digital signature handler
jekuaitk Sep 1, 2026
bb7eff4
352: Set inherited Maestro task data on the submission entity at prep…
jekuaitk Sep 14, 2026
13c94a4
352: Updated CHANGELOG
jekuaitk Sep 14, 2026
a7d727c
Merge pull request #26 from itk-dev/feature/add-handler-and-digital-s…
jekuaitk Sep 14, 2026
2bf94b3
352: Code cleanup
jekuaitk Sep 15, 2026
58f5dc1
Merge remote-tracking branch 'origin/feature/maestro-inherit-data-on-…
jekuaitk Sep 15, 2026
ae61c85
Update build release script
jekuaitk Sep 15, 2026
c550a3e
Updated CHANGELOG
jekuaitk Sep 16, 2026
6d75bbe
Merge pull request #28 from itk-dev/feature/selvbetjening-and-maestro…
jekuaitk Sep 28, 2026
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
This is a hack so the CHANGELOG is messed up.
Generated by build_release.sh
<!-- markdownlint-disable MD024 -->
# OS2Forms Change Log

Expand All @@ -11,6 +13,11 @@ before starting to add changes. Use example [placed in the end of the page](#exa

## [Unreleased]

- [PR-353](https://github.com/OS2Forms/os2forms/pull/353)
- Moved `WebformInheritTask` data inheriting from
`hook_webform_submission_form_alter` to `hook_entity_prepare_form`.
- Set data on the submission.

## [5.1.0] 2026-06-03

- [PR-326](https://github.com/OS2Forms/os2forms/pull/326)
Expand Down
38 changes: 38 additions & 0 deletions build_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

# selvbetjening.aarhuskommune.dk branch
# Setup upstream with OS2Forms CORE
git remote add upstream https://github.com/OS2Forms/os2forms.git
git fetch
git reset --hard 5.1.0
git merge --no-ff origin/feature/maps-element-display
git checkout --theirs CHANGELOG.md
git add CHANGELOG.md
git commit -m "Merge remote-tracking branch 'origin/feature/maps-element-display' into selvbetjening.aarhuskommune.dk"
git merge --no-ff origin/fix/336-avoid-inheriting-data-on-page-transition
git checkout --theirs CHANGELOG.md
git add CHANGELOG.md
git commit -m "Merge remote-tracking branch 'origin/fix/336-avoid-inheriting-data-on-page-transition' into selvbetjening.aarhuskommune.dk"
git merge --no-ff origin/feature/add-first-middle-and-last-name-nemid-elements
git checkout --theirs CHANGELOG.md
git add CHANGELOG.md
git commit -m "Merge remote-tracking branch 'origin/feature/add-first-middle-and-last-name-nemid-elements' into selvbetjening.aarhuskommune.dk"
git merge --no-ff origin/feature/add-states-configuration-to-handlers
git checkout --theirs CHANGELOG.md
git add CHANGELOG.md
git commit -m "Merge remote-tracking branch 'origin/feature/add-states-configuration-to-handlers' into selvbetjening.aarhuskommune.dk"
git merge --no-ff origin/feature/move-digital-signature-configuration-to-handler
# Manually handle conflicts in modules/os2forms_digital_signature/os2forms_digital_signature.install
# git add modules/os2forms_digital_signature/os2forms_digital_signature.install
git checkout --theirs CHANGELOG.md
git add CHANGELOG.md
git commit -m "Merge remote-tracking branch 'origin/feature/move-digital-signature-configuration-to-handler' into selvbetjening.aarhuskommune.dk"
git merge --no-ff origin/feature/maestro-inherit-data-on-prepare-form
git checkout --theirs CHANGELOG.md
git add CHANGELOG.md
git commit -m "Merge remote-tracking branch 'origin/feature/maestro-inherit-data-on-prepare-form' into selvbetjening.aarhuskommune.dk"


docker run --rm --volume .:/app itkdev/php8.4-fpm:latest sed --in-place '1i This is a hack so the CHANGELOG is messed up. \nGenerated by build_release.sh' CHANGELOG.md
git add CHANGELOG.md
git commit -m "Updated CHANGELOG"
22 changes: 17 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"itk-dev/serviceplatformen": "^1.7.1",
"mglaman/composer-drupal-lenient": "^1.0",
"os2web/os2web_audit": "^1.0",
"os2web/os2web_datalookup": "^3.0",
"os2web/os2web_datalookup": "dev-selvbetjening.aarhuskommune.dk as 3.4.0",
"os2web/os2web_key": "^1.0",
"os2web/os2web_nemlogin": "^1.0",
"os2web/os2web_simplesaml": "dev-master",
Expand All @@ -76,16 +76,23 @@
"phpunit/phpunit": "^9.5",
"wsdltophp/packagegenerator": "^4.0"
},
"repositories": {
"drupal": {
"repositories": [
{
"name": "os2web/os2web_datalookup",
"type": "vcs",
"url": "https://github.com/itk-dev/os2web_datalookup"
},
{
"name": "drupal",
"type": "composer",
"url": "https://packages.drupal.org/8"
},
"assets": {
{
"name": "assets",
"type": "composer",
"url": "https://asset-packagist.org"
}
},
],
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
Expand All @@ -100,6 +107,11 @@
"vaimo/composer-patches": true,
"zaporylie/composer-drupal-optimizations": true
},
"policy": {
"advisories": {
"block": false
}
},
"sort-packages": true
},
"extra": {
Expand Down
17 changes: 17 additions & 0 deletions modules/os2forms_attachment/src/Element/AttachmentElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,23 @@ public static function getFileContent(array $element, WebformSubmissionInterface
if ($element['#export_type'] === 'pdf') {
$file_path = NULL;

// Digital signature settings live on the digital signature handler.
// Resolving them here ensures all consumers of the element (email
// handlers, attachment downloads) serve an already signed document
// and render the validation text consistently.
$elementKey = $element['#webform_key'] ?? NULL;
if ($elementKey !== NULL) {
foreach ($webform_submission->getWebform()->getHandlers('os2forms_digital_signature') as $handler) {
$settings = $handler->getConfiguration()['settings'] ?? [];
if ($handler->isEnabled() && ($settings['attachment_element'] ?? '') === $elementKey) {
$element['#digital_signature'] = TRUE;
$element['#digital_signature_position'] = $settings['signature_position']
?? Os2formsAttachmentPrintBuilder::SIGNATURE_POSITION_AFTER_CONTENT;
break;
}
}
}

// If attachment with digital signatur, check if we already have one.
if (isset($element['#digital_signature']) && $element['#digital_signature']) {
// Get scheme.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Drupal\Core\Form\FormStateInterface;
use Drupal\webform\Twig\WebformTwigExtension;
use Drupal\webform\Utility\WebformElementHelper;
use Drupal\os2forms_attachment\Os2formsAttachmentPrintBuilder;
use Drupal\webform_attachment\Plugin\WebformElement\WebformAttachmentBase;

/**
Expand All @@ -28,8 +27,6 @@ protected function defineDefaultProperties() {
'view_mode' => 'html',
'template' => '',
'export_type' => '',
'digital_signature' => '',
'digital_signature_position' => Os2formsAttachmentPrintBuilder::SIGNATURE_POSITION_AFTER_CONTENT,
'exclude_empty' => '',
'exclude_empty_checkbox' => '',
'excluded_elements' => '',
Expand Down Expand Up @@ -91,28 +88,6 @@ public function form(array $form, FormStateInterface $form_state) {
'html' => $this->t('HTML'),
],
];
$form['attachment']['digital_signature'] = [
'#type' => 'checkbox',
'#title' => $this->t('Digital signature'),
];
$form['attachment']['digital_signature_position'] = [
'#type' => 'select',
'#title' => $this->t('Digital signature position'),
'#description' => $this->t('Select where the digital signature validation text should be placed in the PDF document.'),
'#options' => [
Os2formsAttachmentPrintBuilder::SIGNATURE_POSITION_FOOTER => $this->t('Footer (repeats on every page)'),
Os2formsAttachmentPrintBuilder::SIGNATURE_POSITION_HEADER => $this->t('Header (repeats on every page)'),
Os2formsAttachmentPrintBuilder::SIGNATURE_POSITION_AFTER_CONTENT => $this->t('After content (end of document)'),
Os2formsAttachmentPrintBuilder::SIGNATURE_POSITION_BEFORE_CONTENT => $this->t('Before content (start of document)'),
],
'#default_value' => Os2formsAttachmentPrintBuilder::SIGNATURE_POSITION_AFTER_CONTENT,
'#states' => [
'visible' => [
':input[name="properties[digital_signature]"]' => ['checked' => TRUE],
],
],
];

// Set #access so that help is always visible.
WebformElementHelper::setPropertyRecursive($form['attachment']['help'], '#access', TRUE);

Expand Down
32 changes: 32 additions & 0 deletions modules/os2forms_digital_post/os2forms_digital_post.install
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

use Drupal\os2forms_digital_post\Helper\BeskedfordelerHelper;
use Drupal\webform\WebformSubmissionInterface;

/**
* Implements hook_schema().
Expand All @@ -26,3 +27,34 @@ function os2forms_digital_post_update_9001(): void {
'os2web_key',
], TRUE);
}

/**
* Set states config to completed on existing digital post handlers.
*/
function os2forms_digital_post_update_10001(): void {
// To avoid having to load full webforms we load and update webform configs.
$configFactory = \Drupal::configFactory();

foreach ($configFactory->listAll('webform.webform.') as $name) {
$config = $configFactory->getEditable($name);
$handlers = $config->get('handlers');
if (!is_array($handlers)) {
continue;
}

$changed = FALSE;

foreach ($handlers as $handlerKey => $handler) {
// $handler['id'] is the handler plugin id.
if (($handler['id'] ?? NULL) !== 'digital_post_sf1601') {
continue;
}
$handlers[$handlerKey]['settings']['additional']['states'] = [WebformSubmissionInterface::STATE_COMPLETED];
$changed = TRUE;
}

if ($changed) {
$config->set('handlers', $handlers)->save();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ final class WebformHandlerSF1601 extends WebformHandlerBase {
public const RECIPIENT_ELEMENT = 'recipient_element';
public const ATTACHMENT_ELEMENT = 'attachment_element';
public const SENDER_ADDRESS = 'sender_address';
private const string ADDITIONAL = 'additional';
private const string STATES = 'states';

/**
* Maximum length of sender label.
Expand Down Expand Up @@ -76,6 +78,9 @@ public static function create(ContainerInterface $container, array $configuratio
public function defaultConfiguration() {
return [
'debug' => FALSE,
self::ADDITIONAL => [
self::STATES => [WebformSubmissionInterface::STATE_COMPLETED],
],
];
}

Expand Down Expand Up @@ -203,6 +208,31 @@ public function buildConfigurationForm(array $form, FormStateInterface $formStat
'#default_value' => $this->configuration['debug'] ?? NULL,
];

// Additional.
// Lifted from EmailWebformHandler::buildConfigurationForm().
$resultsDisabled = (bool) $this->getWebform()->getSetting('results_disabled');
$form[self::ADDITIONAL] = [
'#type' => 'fieldset',
'#title' => $this->t('Additional settings'),
];
// Settings: States.
$states = (array) ($this->configuration[self::ADDITIONAL][self::STATES] ?? NULL);
$form[self::ADDITIONAL][self::STATES] = [
'#type' => 'checkboxes',
'#title' => $this->t('Run handler when …'),
'#options' => [
WebformSubmissionInterface::STATE_DRAFT_CREATED => $this->t('<b>draft is created</b>.'),
WebformSubmissionInterface::STATE_DRAFT_UPDATED => $this->t('<b>draft is updated</b>.'),
WebformSubmissionInterface::STATE_CONVERTED => $this->t('anonymous <b>submission is converted</b> to authenticated.'),
WebformSubmissionInterface::STATE_COMPLETED => $this->t('<b>submission is completed</b>.'),
WebformSubmissionInterface::STATE_UPDATED => $this->t('<b>submission is updated</b>.'),
WebformSubmissionInterface::STATE_DELETED => $this->t('<b>submission is deleted</b>.'),
WebformSubmissionInterface::STATE_LOCKED => $this->t('<b>submission is locked</b>.'),
],
'#access' => !$resultsDisabled,
'#default_value' => $resultsDisabled ? [WebformSubmissionInterface::STATE_COMPLETED] : $states,
];

return $this->setSettingsParents($form);
}

Expand Down Expand Up @@ -333,6 +363,11 @@ static function (array $action) {
$this->configuration[self::MEMO_ACTIONS] = $actions;

$this->configuration['debug'] = (bool) $formState->getValue('debug');

$additional = $formState->getValue(self::ADDITIONAL);
// Clean up states.
$additional[self::STATES] = array_values(array_filter($additional[self::STATES]));
$this->configuration[self::ADDITIONAL] = $additional;
}

/**
Expand All @@ -341,6 +376,12 @@ static function (array $action) {
* @phpstan-return void
*/
public function postSave(WebformSubmissionInterface $webformSubmission, $update = TRUE) {
$submissionState = $webformSubmission->getWebform()->getSetting('results_disabled') ? WebformSubmissionInterface::STATE_COMPLETED : $webformSubmission->getState();
$enabledStates = (array) ($this->configuration[self::ADDITIONAL][self::STATES] ?? NULL);
if (!in_array($submissionState, $enabledStates)) {
return;
}

$this->helper->createJob($webformSubmission, $this->configuration);
}

Expand Down
14 changes: 11 additions & 3 deletions modules/os2forms_digital_signature/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@ The signature server consists of two parts. A frontend module

### Activating Digital Signature

1. Add the OS2forms attachment element to the form.
2. Indicate that the OS2Forms attachment requires a digital signature.
3. Add the Digital Signature Handler to the webform.
1. Add an attachment-style element to the form (either *OS2Forms Attachment* — generated PDF — or
*OS2forms digital signature document* — uploaded PDF).
2. Add the **Digital Signature** handler to the webform.
3. In the handler configuration, pick the attachment element to sign from the **Attachment element to sign**
dropdown, and choose where the signature validation text should be placed in the generated PDF
(the position only applies to *OS2Forms Attachment* elements; it is ignored for uploaded PDFs).
4. If the form requires an email handler, ensure the trigger is set to **...when submission is locked** in the handler’s
*Additional settings*.

> [!NOTE]
> Prior to this release, the attachment element exposed `Digital signature` and `Digital signature position` properties
> directly. These settings have moved to the handler. Existing forms are migrated automatically by
> `os2forms_digital_signature_update_10001()`.

### Flow Explained

1. Upon form submission, a PDF is generated, saved in the private directory, and sent to the signature service via URL.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ package: 'OS2Forms'
core_version_requirement: ^9 || ^10
dependencies:
- 'webform:webform'
- 'os2forms:os2forms_attachment'

configure: os2forms_digital_signature.settings
Loading
Loading