Skip to content

Commit e4a5e90

Browse files
authored
Merge pull request #330 from OS2Forms/release/5.1.0
Release/5.1.0
2 parents e6a339e + 2bf2ec6 commit e4a5e90

42 files changed

Lines changed: 717 additions & 793 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pr.yml

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,24 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- uses: actions/checkout@v4
26+
27+
- name: Mark repo as safe for git (container)
28+
run: |
29+
docker compose run --rm --user 0 php bash -lc \
30+
'git config --system --add safe.directory /app || git config --global --add safe.directory /app'
31+
32+
- name: Fix ownership (container)
33+
run: |
34+
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'
35+
2636
- name: Validate composer files
2737
run: |
28-
# Note that we don't use the --strict flag on validate due to the
29-
# package drupal/config_entity_revisions 2.0.x-dev being considered a
30-
# version cf.
31-
# https://getcomposer.org/doc/articles/versions.md#branches
32-
docker compose run --rm php composer validate composer.json
38+
docker compose run --rm --user "$(id -u):$(id -g)" php composer validate composer.json
39+
3340
- name: Check that composer file is normalized
3441
run: |
35-
docker compose run --rm php composer install
36-
docker compose run --rm php composer normalize --dry-run
42+
docker compose run --rm --user "$(id -u):$(id -g)" php composer install
43+
docker compose run --rm --user "$(id -u):$(id -g)" php composer normalize --dry-run
3744
3845
test-composer-files:
3946
name: Test composer files
@@ -43,29 +50,50 @@ jobs:
4350
dependency-version: [ prefer-lowest, prefer-stable ]
4451
steps:
4552
- uses: actions/checkout@v4
53+
54+
- name: Fix ownership (container)
55+
run: |
56+
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'
57+
58+
- name: Debug compose + php
59+
run: |
60+
ls -la
61+
docker compose config
62+
docker compose run --rm php php -v
63+
4664
- name: Check that dependencies resolve.
4765
run: |
48-
# Clean up before update (cf. https://www.drupal.org/project/simplesamlphp_auth/issues/3350773)
4966
rm -fr vendor/
50-
docker compose run --rm php composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
67+
docker compose run --rm --user "$(id -u):$(id -g)" php composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
5168
5269
php-coding-standards:
5370
name: PHP coding standards
5471
runs-on: ubuntu-latest
5572
steps:
5673
- uses: actions/checkout@v4
74+
75+
- name: Fix ownership (container)
76+
run: |
77+
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'
78+
5779
- name: Install Dependencies
5880
run: |
59-
docker compose run --rm php composer install
81+
docker compose run --rm --user "$(id -u):$(id -g)" php composer install
82+
6083
- name: PHPCS
6184
run: |
62-
docker compose run --rm php composer coding-standards-check/phpcs
85+
docker compose run --rm --user "$(id -u):$(id -g)" php composer coding-standards-check/phpcs
6386
6487
php-code-analysis:
6588
name: PHP code analysis
6689
runs-on: ubuntu-latest
6790
steps:
6891
- uses: actions/checkout@v4
92+
93+
- name: Fix ownership (container)
94+
run: |
95+
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'
96+
6997
- name: Code analysis
7098
run: |
7199
./scripts/code-analysis

CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,32 @@ before starting to add changes. Use example [placed in the end of the page](#exa
1111

1212
## [Unreleased]
1313

14+
## [5.1.0] 2026-06-03
15+
16+
- [PR-326](https://github.com/OS2Forms/os2forms/pull/326)
17+
Updating ckeditor -> ckeditor5.
18+
- [PR-322](https://github.com/OS2Forms/os2forms/pull/322)
19+
Update Digital Post handler error messages.
20+
- [PR-320](https://github.com/OS2Forms/os2forms/pull/320)
21+
Update README.
22+
- [PR-301](https://github.com/OS2Forms/os2forms/pull/301)
23+
Add address information to Digital Post shipments to ensure "*fjernprint*"
24+
can be sent.
25+
- Add option to add return address to Digital Post shipments.
26+
- [PR-305](https://github.com/OS2Forms/os2forms/pull/305)
27+
Fix IP validation in digital signature file download (CIDR support)
28+
- [PR-317](https://github.com/OS2Forms/os2forms/pull/317)
29+
Updated code analysis script.
30+
- [PR-306](https://github.com/OS2Forms/os2forms/pull/306)
31+
Made digital signature text placement configurable.
32+
- git actions check
33+
- [PR-289](https://github.com/OS2Forms/os2forms/pull/289)
34+
Added required "Zoom control position" to map element
35+
- [#246](https://github.com/OS2Forms/os2forms/issues/246)
36+
Adding Datafordeler address lookup
37+
- [#251](https://github.com/OS2Forms/os2forms/issues/251)
38+
Updated Webform encrypt uninstall problem fix
39+
1440
## [5.0.0] 2025-11-18
1541

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

409-
[Unreleased]: https://github.com/OS2Forms/os2forms/compare/4.1.0...HEAD
435+
[Unreleased]: https://github.com/OS2Forms/os2forms/compare/5.0.0...HEAD
436+
[5.0.0]: https://github.com/OS2Forms/os2forms/compare/4.1.0...5.0.0
410437
[4.1.0]: https://github.com/OS2Forms/os2forms/compare/4.0.0...4.1.0
411438
[4.0.0]: https://github.com/OS2Forms/os2forms/compare/3.22.2...4.0.0
412439
[3.22.2]: https://github.com/OS2Forms/os2forms/compare/3.22.1...3.22.2

README.md

Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,31 @@
22

33
## Install
44

5-
OS2Forms Drupal 8 module is available to download via composer.
5+
OS2Forms Drupal 10 module is available to download via composer.
66

77
```sh
88
composer require os2forms/os2forms
9-
drush en os2forms
9+
drush pm:install os2forms
1010
```
1111

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

15-
We are recommending to install drupal via composer by using
16-
[OS2Forms composer project](https://github.com/OS2Forms/composer-project).
17-
By this way you will get standalone project with OS2Forms module on board, plus
18-
all the other contrib modules you will probably need to configure OS2Forms to
19-
your specific demands.
20-
21-
```sh
22-
composer create-project os2forms/composer-project:8.x-dev some-dir --no-interaction
23-
```
24-
25-
To get more benefits on your Drupal project we are offering you to use
15+
To get more benefits on your Drupal project we recommend you use
2616
[OS2web](https://packagist.org/packages/os2web/os2web) as installation
27-
profile for Drupal. This profile is a part of OS2Forms composer project
28-
mentioned above.
17+
profile for Drupal.
2918

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

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

3827
## Update
3928

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

4332
```sh
@@ -46,53 +35,62 @@ composer outdated os2forms/os2forms
4635

4736
## Automated testing and code quality
4837

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

5140
## Contribution
5241

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

5948
### Code review policy
6049

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

6352
### Git name convention
6453

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

6756
## Important notes
6857

6958
### Webforms
7059

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

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

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

8475
### Serviceplatformen plugins
8576

86-
Settings for CPR and CVR serviceplantormen plugins are storing as configuration
87-
in db and will(could) be exported as `yml` file via Drupal configuration
88-
management system. And afterwards could be tracked by `git`.
77+
Similar to webforms, settings for the CPR and CVR Serviceplatformen plugins
78+
are stored as configuration in the database and can be exported as `yml` files
79+
through Drupal's configuration management system, making them trackable via
80+
`git`.
81+
82+
Note that if your git repository is publicly accessible, these plugin settings
83+
— which may contain sensitive information — will be exposed. As with webforms,
84+
we recommend using the `Config ignore`-module to exclude them from the
85+
export/import process.
8986

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

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

9795
## Unstable features
9896

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

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

151-
Running statis code analysis on a standalone Drupal module is a bit tricky, so we use a helper script to run the
149+
Running static code analysis on a standalone Drupal module is a bit tricky, so we use a helper script to run the
152150
analysis:
153151

154152
```shell
155153
docker compose run --rm php ./scripts/code-analysis
156154
```
157155

158-
**Note**: Currently the code analysis is only run on the `os2forms_digital_post` sub-module (cf. [`phpstan.neon`](./phpstan.neon)).
156+
**Note**: Currently the code analysis is only run on the `os2forms_digital_post` and `os2forms_fbs_handler` sub-modules
157+
(cf. [`phpstan.neon`](./phpstan.neon)).

compose.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,22 @@
22

33
services:
44
php:
5-
image: ddev/ddev-php-base
5+
image: ddev/ddev-php-base:v1.24.10-old
66
profiles:
77
- dev
88
working_dir: /app
99
volumes:
1010
- ./:/app
11+
environment:
12+
COMPOSER_HOME: /tmp/composer
13+
COMPOSER_CACHE_DIR: /tmp/composer-cache
14+
entrypoint:
15+
- bash
16+
- -lc
17+
- |
18+
git config --global --add safe.directory /app
19+
exec "$@"
20+
- bash
1121

1222
markdownlint:
1323
image: itkdev/markdownlint

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "os2forms/os2forms",
3-
"description": "Drupal 8 OS2Form module provides advanced webform functionality for Danish Municipalities",
3+
"description": "Drupal 10 OS2Form module provides advanced webform functionality for Danish Municipalities",
44
"license": "EUPL-1.2",
55
"type": "drupal-module",
66
"require": {
@@ -128,7 +128,7 @@
128128
"Add custom hook (hook_webform_post_load_data) for audit logging": "https://gist.githubusercontent.com/cableman/d26898fc8f65ee0a31001bf391583b59/raw/6189dc4c2ceaabb19d25cc4b98b0b3028a6b0e1e/gistfile1.txt"
129129
},
130130
"drupal/webform_encrypt": {
131-
"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",
131+
"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",
132132
"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"
133133
},
134134
"drupal/webform_node_element": {

modules/os2forms_attachment/src/Element/AttachmentElement.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Drupal\os2forms_attachment\Element;
44

5+
use Drupal\os2forms_attachment\Os2formsAttachmentPrintBuilder;
56
use Drupal\webform\Entity\WebformSubmission;
67
use Drupal\webform\WebformSubmissionInterface;
78
use Drupal\webform_attachment\Element\WebformAttachmentBase;
@@ -21,6 +22,7 @@ public function getInfo() {
2122
'#view_mode' => 'html',
2223
'#export_type' => 'pdf',
2324
'#digital_signature' => FALSE,
25+
'#digital_signature_position' => Os2formsAttachmentPrintBuilder::SIGNATURE_POSITION_AFTER_CONTENT,
2426
'#template' => '',
2527
];
2628
}
@@ -77,7 +79,8 @@ public static function getFileContent(array $element, WebformSubmissionInterface
7779

7880
// Adding digital signature.
7981
if (isset($element['#digital_signature']) && $element['#digital_signature']) {
80-
$file_path = $print_builder->savePrintableDigitalSignature([$webform_submission], $print_engine, $scheme, $file_name);
82+
$signaturePosition = $element['#digital_signature_position'] ?? Os2formsAttachmentPrintBuilder::SIGNATURE_POSITION_AFTER_CONTENT;
83+
$file_path = $print_builder->savePrintableDigitalSignature([$webform_submission], $print_engine, $scheme, $file_name, TRUE, $signaturePosition);
8184
}
8285
else {
8386
$file_path = $print_builder->savePrintable([$webform_submission], $print_engine, $scheme, $file_name);

0 commit comments

Comments
 (0)