Skip to content

Commit 4e39f4b

Browse files
authored
Merge branch 'develop' into feature/digital-signature-placement
2 parents f972417 + b79b2b1 commit 4e39f4b

7 files changed

Lines changed: 81 additions & 24 deletions

File tree

.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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ before starting to add changes. Use example [placed in the end of the page](#exa
1313

1414
- [PR-306](https://github.com/OS2Forms/os2forms/pull/306)
1515
Made digital signature text placement configurable.
16+
- [#251](https://github.com/OS2Forms/os2forms/issues/251)
17+
Webform encrypt uninstall problem fix
18+
- git actions check
19+
- [PR-289](https://github.com/OS2Forms/os2forms/pull/289)
20+
Added required "Zoom control position" to map element
1621

1722
## [5.0.0] 2025-11-18
1823

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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_webform_maps/os2forms_webform_maps.libraries.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
webformmap:
22
version: 1.x
3-
css:
4-
theme:
5-
css/webform_map.css: {}
63
js:
74
js/webform_map.js: {}
85
dependencies:

modules/os2forms_webform_maps/src/Element/WebformLeafletMapField.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Drupal\Core\Form\FormStateInterface;
66
use Drupal\Core\Render\Element\FormElement;
77
use Drupal\webform\Element\WebformCompositeFormElementTrait;
8+
use Drupal\os2forms_webform_maps\Plugin\WebformElement\WebformLeafletMapField as WebformLeafletMapElement;
89

910
/**
1011
* Provides a webform_map_field.
@@ -36,7 +37,7 @@ public function getInfo() {
3637
'#minZoom' => 1,
3738
'#maxZoom' => 18,
3839
'#zoomFiner' => 0,
39-
'#position' => 'topleft',
40+
'#position' => WebformLeafletMapElement::LEAFLET_POSITION_TOP_LEFT,
4041
'#marker' => 'defaultMarker',
4142
'#drawPolyline' => 0,
4243
'#drawRectangle' => 0,
@@ -90,6 +91,7 @@ public static function processWebformMapElement(&$element, FormStateInterface $f
9091
'zoomFiner' => $element['#zoomFiner'],
9192
'minZoom' => $element['#minZoom'],
9293
'maxZoom' => $element['#maxZoom'],
94+
'zoomControlPosition' => $element['#zoomControlPosition'] ?? WebformLeafletMapElement::LEAFLET_POSITION_TOP_LEFT,
9395
'center' => [
9496
'lat' => (float) $element['#lat'],
9597
'lon' => (float) $element['#lon'],

modules/os2forms_webform_maps/src/Plugin/WebformElement/WebformLeafletMapField.php

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ class WebformLeafletMapField extends WebformElementBase {
2020

2121
use LeafletSettingsElementsTrait;
2222

23+
// Valid Leaflet control positions (cf.
24+
// https://github.com/Leaflet/Leaflet/blob/main/src/control/Control.js).
25+
const string LEAFLET_POSITION_TOP_LEFT = 'topleft';
26+
const string LEAFLET_POSITION_TOP_RIGHT = 'topright';
27+
const string LEAFLET_POSITION_BOTTOM_LEFT = 'bottomleft';
28+
const string LEAFLET_POSITION_BOTTOM_RIGHT = 'bottomright';
29+
2330
/**
2431
* {@inheritdoc}
2532
*/
@@ -33,10 +40,11 @@ public function defineDefaultProperties(): array {
3340
'minZoom' => 1,
3441
'maxZoom' => 18,
3542
'zoomFiner' => 0,
43+
'zoomControlPosition' => self::LEAFLET_POSITION_TOP_LEFT,
3644
'scrollWheelZoom' => 0,
3745
'doubleClickZoom' => 1,
3846

39-
'position' => 'topleft',
47+
'position' => self::LEAFLET_POSITION_TOP_LEFT,
4048
'marker' => 'defaultMarker',
4149
'drawPolyline' => 0,
4250
'drawRectangle' => 0,
@@ -72,6 +80,13 @@ public function form(array $form, FormStateInterface $form_state) {
7280
$form = parent::form($form, $form_state);
7381
$map_keys = array_keys(leaflet_map_get_info());
7482

83+
$positionOptions = [
84+
self::LEAFLET_POSITION_TOP_LEFT => $this->t('topleft'),
85+
self::LEAFLET_POSITION_TOP_RIGHT => $this->t('topright'),
86+
self::LEAFLET_POSITION_BOTTOM_LEFT => $this->t('bottomleft'),
87+
self::LEAFLET_POSITION_BOTTOM_RIGHT => $this->t('bottomright'),
88+
];
89+
7590
$form['mapstyles'] = [
7691
'#type' => 'fieldset',
7792
'#title' => $this->t('Map settings'),
@@ -139,6 +154,11 @@ public function form(array $form, FormStateInterface $form_state) {
139154
'#step' => 1,
140155
'#description' => $this->t('Value that might/will be added to default Fit Elements Bounds Zoom. (-5 / +5)'),
141156
],
157+
'zoomControlPosition' => [
158+
'#type' => 'select',
159+
'#title' => $this->t('Zoom control position'),
160+
'#options' => $positionOptions,
161+
],
142162
'scrollWheelZoom' => [
143163
'#type' => 'checkbox',
144164
'#title' => $this->t('Enable Scroll Wheel Zoom on click'),
@@ -159,12 +179,7 @@ public function form(array $form, FormStateInterface $form_state) {
159179
'position' => [
160180
'#type' => 'select',
161181
'#title' => $this->t('Toolbar position.'),
162-
'#options' => [
163-
'topleft' => $this->t('topleft'),
164-
'topright' => $this->t('topright'),
165-
'bottomleft' => $this->t('bottomleft'),
166-
'bottomright' => $this->t('bottomright'),
167-
],
182+
'#options' => $positionOptions,
168183
],
169184
'marker' => [
170185
'#type' => 'radios',

0 commit comments

Comments
 (0)