Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
6e81c86
Merge pull request #241 from OS2Forms/master
stankut Nov 18, 2025
5efb744
Added required "Zoom control position" to map element
rimi-itk Feb 3, 2026
76a63ba
Removed reference to nonexistent CSS file
rimi-itk Feb 3, 2026
c46ffda
Updated changelog
rimi-itk Feb 3, 2026
0d8224a
288: Add address element to generated html during digital post
jekuaitk Feb 6, 2026
ba26c19
288: Updated CHANGELOG
jekuaitk Feb 6, 2026
d85e112
#251 webform encrypt uninstall fix
stankut Feb 6, 2026
e0815dc
288: Added comment to preg_replace
jekuaitk Feb 10, 2026
1fca0a2
288: Ensured required fields are set before accessing them
jekuaitk Feb 10, 2026
d25ba3e
288: Switched to h-card and saving lookup result in session
jekuaitk Feb 10, 2026
cfdd08f
288: Updated README with injected html and example styling
jekuaitk Feb 10, 2026
e3a719a
288: Cleaned up example styling
jekuaitk Feb 10, 2026
fdaafd5
Update modules/os2forms_digital_post/src/EventSubscriber/Os2formsDigi…
jekuaitk Feb 16, 2026
a552beb
Update modules/os2forms_digital_post/README.md
jekuaitk Feb 16, 2026
7ed8d8f
Update modules/os2forms_digital_post/README.md
jekuaitk Feb 16, 2026
0c39739
Update modules/os2forms_digital_post/src/EventSubscriber/Os2formsDigi…
jekuaitk Feb 16, 2026
423219b
Used constants for positions
rimi-itk Feb 16, 2026
de2282a
Fix IP validation in digital signature file download (CIDR support)
cableman Feb 17, 2026
a95445d
Switch digital signatur ip range check to use symfony function
cableman Feb 18, 2026
7fb5332
Made digital signature text placement on attachment configurable
jekuaitk Feb 19, 2026
96c578c
Comment and CHANGELOG
jekuaitk Feb 19, 2026
f972417
Use constants
jekuaitk Feb 19, 2026
a6e6f1f
Added missing comma in address
jekuaitk Feb 19, 2026
7c057aa
Updated README
jekuaitk Feb 19, 2026
a99952c
Cleanup
jekuaitk Feb 23, 2026
cac654d
Change to git file permissions error on build
skifter Feb 25, 2026
4f782d9
Change 2 to make repo safe for git
skifter Feb 25, 2026
300ffa3
Changing image to use older wersion with php-3
skifter Feb 25, 2026
6b3e0b5
Debug
skifter Feb 25, 2026
e3dcb38
Merge pull request #308 from OS2Forms/fix-ci-php83-safe
skifter Feb 25, 2026
b077a9c
Merge pull request #289 from itk-dev/feature/maps-element
rimi-itk Feb 25, 2026
18f91db
CI: reset pipeline
skifter Feb 25, 2026
5746f0c
Merge pull request #310 from OS2Forms/test/ci-retest
skifter Feb 25, 2026
eeba74b
Ensure address is added to both digital post pdf and fjernprint pdf
jekuaitk Mar 9, 2026
c2f112e
Merge branch 'develop' into f/251_webform_encrypt_uninstall
stankut Mar 9, 2026
b79b2b1
Merge pull request #302 from OS2Forms/f/251_webform_encrypt_uninstall
stankut Mar 9, 2026
5fdc5d4
Adjusted when context is set and removed
jekuaitk Mar 12, 2026
4e39f4b
Merge branch 'develop' into feature/digital-signature-placement
jekuaitk Mar 12, 2026
b2031bc
Merge pull request #306 from itk-dev/feature/digital-signature-placement
jekuaitk Mar 12, 2026
ed4c707
Added option to add sender address to digital post
jekuaitk Mar 13, 2026
8fbeeaa
Updated README with styling of sender adress
jekuaitk Mar 13, 2026
381f438
Added max length for sender and checks for context being correctly set
jekuaitk Mar 16, 2026
ee98943
Update modules/os2forms_digital_post/src/EventSubscriber/Os2formsDigi…
jekuaitk Mar 16, 2026
5a644a1
Update modules/os2forms_digital_post/src/Plugin/WebformHandler/Webfor…
jekuaitk Mar 16, 2026
4335ee3
Updated digital post README with sender address
jekuaitk Mar 16, 2026
e0794f6
Updated CHANGELOG
jekuaitk Mar 23, 2026
fc3d2c4
Merge pull request #13 from itk-dev/feature/sender-address-in-digital…
jekuaitk Mar 23, 2026
a4fce86
Merge branch 'develop' into feature/address-in-digital-post-pdfs
jekuaitk Mar 23, 2026
e7c58e5
Updated Digital Post README
jekuaitk Mar 23, 2026
929fd95
Fixed code analysis script
jekuaitk Mar 23, 2026
5092830
Updated CHANGELOG
jekuaitk Mar 23, 2026
5fc32cb
Merge pull request #317 from itk-dev/fix/update-code-analysis-script
jekuaitk Mar 23, 2026
d8bc9f5
Merge branch 'develop' into feature/address-in-digital-post-pdfs
jekuaitk Mar 23, 2026
54d9950
Added missing array return declaration
jekuaitk Mar 23, 2026
579d11e
Applied coding standards
jekuaitk Mar 23, 2026
f5fac02
Code cleanup
jekuaitk Mar 23, 2026
d9b4a02
Merge branch 'develop' into feature/digital_signature_ips
jekuaitk Mar 25, 2026
c14172e
Merge pull request #305 from itk-dev/feature/digital_signature_ips
jekuaitk Mar 25, 2026
ec1fe42
Merge branch 'develop' into feature/address-in-digital-post-pdfs
jekuaitk Mar 27, 2026
f64cd24
Merge pull request #301 from itk-dev/feature/address-in-digital-post-…
jekuaitk Mar 27, 2026
65e419a
Update README
jekuaitk Mar 31, 2026
f1531f7
Update CHANGELOG
jekuaitk Mar 31, 2026
6bc862a
Merge pull request #320 from itk-dev/feature/update-readme
jekuaitk Apr 1, 2026
c3f8309
Adjust Digital Post error messages
jekuaitk Apr 8, 2026
433a83a
Updated CHANGELOG
jekuaitk Apr 8, 2026
ab100d1
Merge pull request #322 from itk-dev/feature/adjust-digital-post-erro…
jekuaitk Apr 9, 2026
d0301c6
#200 updating ckeditor -> ckeditor5 (#326)
stankut May 8, 2026
dcc5155
OS-219 adding config object delete on uninstall
stankut May 18, 2026
149ad4a
Merge pull request #328 from OS2Forms/f/OS-219_encrypt_uninstall
stankut May 25, 2026
3310697
OS-244 #246 Adding Datafordeler address lookup (#327)
stankut May 29, 2026
2bf2ec6
Adding 5.1.0 version
stankut Jun 3, 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
50 changes: 39 additions & 11 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Mark repo as safe for git (container)
run: |
docker compose run --rm --user 0 php bash -lc \
'git config --system --add safe.directory /app || git config --global --add safe.directory /app'

- name: Fix ownership (container)
run: |
docker compose run --rm --user 0 -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) php bash -lc 'chown -R ${HOST_UID}:${HOST_GID} /app'

- name: Validate composer files
run: |
# Note that we don't use the --strict flag on validate due to the
# package drupal/config_entity_revisions 2.0.x-dev being considered a
# version cf.
# https://getcomposer.org/doc/articles/versions.md#branches
docker compose run --rm php composer validate composer.json
docker compose run --rm --user "$(id -u):$(id -g)" php composer validate composer.json

- name: Check that composer file is normalized
run: |
docker compose run --rm php composer install
docker compose run --rm php composer normalize --dry-run
docker compose run --rm --user "$(id -u):$(id -g)" php composer install
docker compose run --rm --user "$(id -u):$(id -g)" php composer normalize --dry-run

test-composer-files:
name: Test composer files
Expand All @@ -43,29 +50,50 @@ jobs:
dependency-version: [ prefer-lowest, prefer-stable ]
steps:
- uses: actions/checkout@v4

- name: Fix ownership (container)
run: |
docker compose run --rm --user 0 -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) php bash -lc 'chown -R ${HOST_UID}:${HOST_GID} /app'

- name: Debug compose + php
run: |
ls -la
docker compose config
docker compose run --rm php php -v

- name: Check that dependencies resolve.
run: |
# Clean up before update (cf. https://www.drupal.org/project/simplesamlphp_auth/issues/3350773)
rm -fr vendor/
docker compose run --rm php composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
docker compose run --rm --user "$(id -u):$(id -g)" php composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction

php-coding-standards:
name: PHP coding standards
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Fix ownership (container)
run: |
docker compose run --rm --user 0 -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) php bash -lc 'chown -R ${HOST_UID}:${HOST_GID} /app'

- name: Install Dependencies
run: |
docker compose run --rm php composer install
docker compose run --rm --user "$(id -u):$(id -g)" php composer install

- name: PHPCS
run: |
docker compose run --rm php composer coding-standards-check/phpcs
docker compose run --rm --user "$(id -u):$(id -g)" php composer coding-standards-check/phpcs

php-code-analysis:
name: PHP code analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Fix ownership (container)
run: |
docker compose run --rm --user 0 -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) php bash -lc 'chown -R ${HOST_UID}:${HOST_GID} /app'

- name: Code analysis
run: |
./scripts/code-analysis
Expand Down
29 changes: 28 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,32 @@ before starting to add changes. Use example [placed in the end of the page](#exa

## [Unreleased]

## [5.1.0] 2026-06-03

- [PR-326](https://github.com/OS2Forms/os2forms/pull/326)
Updating ckeditor -> ckeditor5.
- [PR-322](https://github.com/OS2Forms/os2forms/pull/322)
Update Digital Post handler error messages.
- [PR-320](https://github.com/OS2Forms/os2forms/pull/320)
Update README.
- [PR-301](https://github.com/OS2Forms/os2forms/pull/301)
Add address information to Digital Post shipments to ensure "*fjernprint*"
can be sent.
- Add option to add return address to Digital Post shipments.
- [PR-305](https://github.com/OS2Forms/os2forms/pull/305)
Fix IP validation in digital signature file download (CIDR support)
- [PR-317](https://github.com/OS2Forms/os2forms/pull/317)
Updated code analysis script.
- [PR-306](https://github.com/OS2Forms/os2forms/pull/306)
Made digital signature text placement configurable.
- git actions check
- [PR-289](https://github.com/OS2Forms/os2forms/pull/289)
Added required "Zoom control position" to map element
- [#246](https://github.com/OS2Forms/os2forms/issues/246)
Adding Datafordeler address lookup
- [#251](https://github.com/OS2Forms/os2forms/issues/251)
Updated Webform encrypt uninstall problem fix

## [5.0.0] 2025-11-18

- [PR-192](https://github.com/OS2Forms/os2forms/pull/192)
Expand Down Expand Up @@ -406,7 +432,8 @@ f/OS-115_dawa_address
- Security in case of vulnerabilities.
```

[Unreleased]: https://github.com/OS2Forms/os2forms/compare/4.1.0...HEAD
[Unreleased]: https://github.com/OS2Forms/os2forms/compare/5.0.0...HEAD
[5.0.0]: https://github.com/OS2Forms/os2forms/compare/4.1.0...5.0.0
[4.1.0]: https://github.com/OS2Forms/os2forms/compare/4.0.0...4.1.0
[4.0.0]: https://github.com/OS2Forms/os2forms/compare/3.22.2...4.0.0
[3.22.2]: https://github.com/OS2Forms/os2forms/compare/3.22.1...3.22.2
Expand Down
91 changes: 45 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,31 @@

## Install

OS2Forms Drupal 8 module is available to download via composer.
OS2Forms Drupal 10 module is available to download via composer.

```sh
composer require os2forms/os2forms
drush en os2forms
drush pm:install os2forms
```

If you don't have Drupal installed on you server, you will to need install it first.
Read more about [how to install drupal core](https://www.drupal.org/docs/8/install).
Read more about [how to install drupal core](https://www.drupal.org/docs/getting-started/installing-drupal).

We are recommending to install drupal via composer by using
[OS2Forms composer project](https://github.com/OS2Forms/composer-project).
By this way you will get standalone project with OS2Forms module on board, plus
all the other contrib modules you will probably need to configure OS2Forms to
your specific demands.

```sh
composer create-project os2forms/composer-project:8.x-dev some-dir --no-interaction
```

To get more benefits on your Drupal project we are offering you to use
To get more benefits on your Drupal project we recommend you use
[OS2web](https://packagist.org/packages/os2web/os2web) as installation
profile for Drupal. This profile is a part of OS2Forms composer project
mentioned above.
profile for Drupal.

You can easy download and install OS2web installation profile to your
composer based Drupal project with commands:

```sh
composer require os2web/os2web
drush si os2web --db-url=mysql://db_user:db_pass@mysql_host/db_name --locale=da --site-name="OS2Forms" --account-pass=admin -y
drush site:install os2web --db-url=mysql://db_user:db_pass@mysql_host/db_name --locale=da --site-name="OS2Forms" --account-pass=admin -y
```

## Update

Updating process for OS2forms module is similar to usual Drupal 8 module.
Updating process for OS2forms module is similar to usual Drupal 10 module.
Use Composer's built-in command for listing packages that have updates available:

```sh
Expand All @@ -46,53 +35,62 @@ composer outdated os2forms/os2forms

## Automated testing and code quality

See [OS2Forms testing and CI information](https://github.com/OS2Forms/docs#testing-and-ci)
See [OS2Forms testing and CI information](https://os2forms.github.io/os2forms-docs/for-developers.html#testing-and-ci)

## Contribution

OS2Forms project is opened for new features and os course bugfixes.
If you have any suggestion or you found a bug in project, you are very welcome
to create an issue in github repository issue tracker.
For issue description there is expected that you will provide clear and
sufficient information about your feature request or bug report.
The OS2Forms project is open for new features and bugfixes. If you have any
suggestion, or you found a bug in the project, you are very welcome to create
an issue in github repository issue tracker. For issue description was ask
that you will provide clear and sufficient information about your feature
request or bug report.

### Code review policy

See [OS2Forms code review policy](https://github.com/OS2Forms/docs#code-review)
See [OS2Forms code review policy](https://os2forms.github.io/os2forms-docs/for-developers.html#code-review)

### Git name convention

See [OS2Forms git name convention](https://github.com/OS2Forms/docs#git-guideline)
See [OS2Forms git name convention](https://os2forms.github.io/os2forms-docs/for-developers.html#git-guideline)

## Important notes

### Webforms

Each webform, including all its settings, is stored as configuration in db and
will(could) be exported as `yml` file via Drupal configuration management
system. And afterwards could be tracked by `git`.
Each webform, along with all its settings, is stored as configuration in the
database and can be exported as a `yml` file through Drupal's configuration
management system, making it trackable via `git`.

It means that all webform settings from drupal database will
be syncronized (exported/imported) with state stored in `yml` files from
configuration folder stored in git repository. Without proper actions webforms
could be deleted or reverted to state in `yml` during synchronization.
This means that webform settings in the Drupal database will be synchronized
(exported/imported) with the state defined in `yml` files located in the
configuration folder of your git repository. Without taking the appropriate
precautions, webforms may be deleted or reverted to the state captured in
those `yml` files during synchronization.

To avoid/prevent this behavior we recommend use `Config ignore` module, where
you can add all settings you do not want to export/import via configuration
management system.
To prevent this, we recommend using the
`Config ignore`-[module](https://www.drupal.org/project/config_ignore), which
allows you to exclude specific settings from the configuration management
export/import process.

### Serviceplatformen plugins

Settings for CPR and CVR serviceplantormen plugins are storing as configuration
in db and will(could) be exported as `yml` file via Drupal configuration
management system. And afterwards could be tracked by `git`.
Similar to webforms, settings for the CPR and CVR Serviceplatformen plugins
are stored as configuration in the database and can be exported as `yml` files
through Drupal's configuration management system, making them trackable via
`git`.

Note that if your git repository is publicly accessible, these plugin settings
— which may contain sensitive information — will be exposed. As with webforms,
we recommend using the `Config ignore`-module to exclude them from the
export/import process.

If case you have public access to your git repository all setting from plugins
will be exposed for third persons.
### Other configuration

To avoid/prevent this behavior we recommend use `Config ignore` module, where
you can add all settings you do not want to export/import via configuration
management system.
The two cases above are just some examples of configuration that may be
sensitive or subject to unintended changes during synchronization. In general,
any configuration that is environment-specific, contains sensitive data, or is
managed directly in the database rather than through code should be considered
for exclusion via the `Config ignore`-module.

## Unstable features

Expand Down Expand Up @@ -148,11 +146,12 @@ docker compose run --rm markdownlint markdownlint '**/*.md'

We use [PHPStan](https://phpstan.org/) for static code analysis.

Running statis code analysis on a standalone Drupal module is a bit tricky, so we use a helper script to run the
Running static code analysis on a standalone Drupal module is a bit tricky, so we use a helper script to run the
analysis:

```shell
docker compose run --rm php ./scripts/code-analysis
```

**Note**: Currently the code analysis is only run on the `os2forms_digital_post` sub-module (cf. [`phpstan.neon`](./phpstan.neon)).
**Note**: Currently the code analysis is only run on the `os2forms_digital_post` and `os2forms_fbs_handler` sub-modules
(cf. [`phpstan.neon`](./phpstan.neon)).
12 changes: 11 additions & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@

services:
php:
image: ddev/ddev-php-base
image: ddev/ddev-php-base:v1.24.10-old
profiles:
- dev
working_dir: /app
volumes:
- ./:/app
environment:
COMPOSER_HOME: /tmp/composer
COMPOSER_CACHE_DIR: /tmp/composer-cache
entrypoint:
- bash
- -lc
- |
git config --global --add safe.directory /app
exec "$@"
- bash

markdownlint:
image: itkdev/markdownlint
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "os2forms/os2forms",
"description": "Drupal 8 OS2Form module provides advanced webform functionality for Danish Municipalities",
"description": "Drupal 10 OS2Form module provides advanced webform functionality for Danish Municipalities",
"license": "EUPL-1.2",
"type": "drupal-module",
"require": {
Expand Down Expand Up @@ -128,7 +128,7 @@
"Add custom hook (hook_webform_post_load_data) for audit logging": "https://gist.githubusercontent.com/cableman/d26898fc8f65ee0a31001bf391583b59/raw/6189dc4c2ceaabb19d25cc4b98b0b3028a6b0e1e/gistfile1.txt"
},
"drupal/webform_encrypt": {
"Ensure data is base64 encoded (https://www.drupal.org/project/webform_encrypt/issues/3399414)": "https://git.drupalcode.org/project/webform_encrypt/-/merge_requests/4.patch",
"Ensure data is base64 encoded (https://www.drupal.org/project/webform_encrypt/issues/3399414)": "https://www.drupal.org/files/issues/2026-02-06/patch.diff",
"PHP Warning if unserialize fails (https://www.drupal.org/project/webform_encrypt/issues/3292305)": "https://www.drupal.org/files/issues/2022-06-23/unserialize-php-notice.patch"
},
"drupal/webform_node_element": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Drupal\os2forms_attachment\Element;

use Drupal\os2forms_attachment\Os2formsAttachmentPrintBuilder;
use Drupal\webform\Entity\WebformSubmission;
use Drupal\webform\WebformSubmissionInterface;
use Drupal\webform_attachment\Element\WebformAttachmentBase;
Expand All @@ -21,6 +22,7 @@ public function getInfo() {
'#view_mode' => 'html',
'#export_type' => 'pdf',
'#digital_signature' => FALSE,
'#digital_signature_position' => Os2formsAttachmentPrintBuilder::SIGNATURE_POSITION_AFTER_CONTENT,
'#template' => '',
];
}
Expand Down Expand Up @@ -77,7 +79,8 @@ public static function getFileContent(array $element, WebformSubmissionInterface

// Adding digital signature.
if (isset($element['#digital_signature']) && $element['#digital_signature']) {
$file_path = $print_builder->savePrintableDigitalSignature([$webform_submission], $print_engine, $scheme, $file_name);
$signaturePosition = $element['#digital_signature_position'] ?? Os2formsAttachmentPrintBuilder::SIGNATURE_POSITION_AFTER_CONTENT;
$file_path = $print_builder->savePrintableDigitalSignature([$webform_submission], $print_engine, $scheme, $file_name, TRUE, $signaturePosition);
}
else {
$file_path = $print_builder->savePrintable([$webform_submission], $print_engine, $scheme, $file_name);
Expand Down
Loading
Loading