Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ indent_style = space
indent_size = 2

[{*.txt,wp-config-sample.php}]
end_of_line = crlf
end_of_line = crlf

[*.md]
indent_style = space
indent_size = 4
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
!.eslintrc
!.eslintignore

# Prettier
!.prettierignore

# track .editorconfig file (i.e. do NOT ignore it)
!.editorconfig

Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGELOG.md
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [Unreleased]

- Added: migrate forms and personal data blocks from a V1 supplier (EnableU, PinkRoccade, VrijBRP) to a V2 supplier (EnableU V2, PinkRoccade V2) when changing the supplier in the add-on settings, after confirmation
- Changed: personal data block only shows the options of the API version of the selected supplier
- Added: WP-CLI command `wp prefill migrate-supplier` to migrate forms and personal data blocks to a V2 supplier, use `--check` to verify migrated forms afterwards

## [v2.1.3] - 2026-11-23

- Fix: disabled form fields
Expand Down
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,28 @@ In addition, at least one of the following plug-ins must be installed to enable
2. Go to the form settings of the form you want to configure.
3. Scroll down and look for the 'OWC Prefill' panel and configure the settings.

### Migrating from a V1 to a V2 supplier

When the supplier in the add-on settings is changed from a V1 supplier (EnableU, PinkRoccade or VrijBRP) to a V2 supplier (EnableU V2 or PinkRoccade V2), you will be asked to migrate the linked forms and personal data blocks. Every V1 supplier can be migrated to every V2 supplier, e.g. VrijBRP to EnableU V2.
After confirming, the supplier in the form settings is switched and the linked fields are mapped to their V2 counterparts, see `config/supplier-migrations/`.
Fields without a V2 counterpart and forms using a mapping file from the theme are reported after saving and need to be updated manually.
The original values are kept in the form setting `owc-form-setting-supplier-legacy` and the field property `linkedFieldValueLegacy`.

The migration can also be run with WP-CLI, use `--dry-run` to see what will be migrated first:

```sh
wp prefill migrate-supplier enable-u enable-u-v2 --dry-run
wp prefill migrate-supplier vrij-brp enable-u-v2
```

After linking the reported fields manually, use `--check` to verify the migrated forms. It lists fields that are still unlinked or linked to an unknown V2 option, and forms or blocks that are not migrated yet. Nothing is changed and the command exits with an error when issues are found:

```sh
wp prefill migrate-supplier vrij-brp enable-u-v2 --check
```

On a multisite, add `--url=<site>` to migrate a specific site.

### Cache Encryption

To enable secure caching of sensitive data, you **must define an encryption key** in your `wp-config.php` file. This key is used to encrypt and decrypt the cached data and should be kept secret at all times.
Expand Down Expand Up @@ -102,12 +124,12 @@ This plugin ships with two Gutenberg blocks for displaying personal data of the

Each Personal Data Row block must be configured in the block sidebar:

| Setting | Description |
|---|---|
| Supplier | Must match the supplier configured in the plugin settings. |
| Setting | Description |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Supplier | Must match the supplier configured in the plugin settings. |
| Goal binding (Doelbinding) | Required for HaalCentraal API v2 — determines which fields are returned. Describes why the personal data is being requested and under which legal task or authority the organization does so. |
| Processing (Verwerking) | Optional for HaalCentraal API v2. Describes for which work process or process step the BRP data is being requested. |
| Personal data field | The specific BRP attribute to display (e.g. name, date of birth). |
| Processing (Verwerking) | Optional for HaalCentraal API v2. Describes for which work process or process step the BRP data is being requested. |
| Personal data field | The specific BRP attribute to display (e.g. name, date of birth). |

## Logging

Expand Down
4 changes: 0 additions & 4 deletions TODO.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return ['dependencies' => ['react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'], 'version' => 'df0a722bfd18e3eb3f64'];
<?php return ['dependencies' => ['react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'], 'version' => '634ba1e632324dd12941'];
2 changes: 1 addition & 1 deletion build/personal-data-table/personal-data-row/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/supplier-migration.asset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return ['dependencies' => [], 'version' => '7f54652d5ce551171503'];
1 change: 1 addition & 0 deletions build/supplier-migration.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions config/supplier-migrations/block_options.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

/**
* Maps the 'selectedOption' attribute of the 'personal-data-row' block from the V1 to the V2 option.
*
* Options that are not listed remain unchanged, these are translated on runtime by the PersonalDataService.
* The mapped values must be available in resources/js/blocks/personal-data-table/personal-data-row/config/personalDataOptions.js.
*
* @since NEXT
*/
return [
'verblijfplaats.straat' => ['value' => 'verblijfplaats.verblijfadres.officieleStraatnaam', 'label' => 'Straat'],
'verblijfplaats.straatnaam' => ['value' => 'verblijfplaats.verblijfadres.officieleStraatnaam', 'label' => 'Straat'],
'verblijfplaats.woonplaats' => ['value' => 'verblijfplaats.verblijfadres.woonplaats', 'label' => 'Woonplaats'],
'verblijfplaats.woonplaatsnaam' => ['value' => 'verblijfplaats.verblijfadres.woonplaats', 'label' => 'Woonplaats'],
'naam.aanduidingNaamgebruik' => ['value' => 'naam.aanduidingNaamgebruik.omschrijving', 'label' => 'Aanduiding Naamgebruik'],
];
16 changes: 16 additions & 0 deletions config/supplier-migrations/sources/enable-u.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

use OWC\PrefillGravityForms\SupplierMigration\V1ToV2FieldMapping;

/**
* Maps the 'linkedFieldValue' of EnableU (V1) fields to the V2 option.
* Fields without a V2 counterpart (null or not listed) need to be linked manually after migrating.
*
* @since NEXT
*/
return array_merge(V1ToV2FieldMapping::base(), [
'verblijfplaats.straatnaam' => 'verblijfplaats.verblijfadres.officieleStraatnaam',
'verblijfplaats.woonplaatsnaam' => 'verblijfplaats.verblijfadres.woonplaats',
]);
17 changes: 17 additions & 0 deletions config/supplier-migrations/sources/pink-roccade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

use OWC\PrefillGravityForms\SupplierMigration\V1ToV2FieldMapping;

/**
* Maps the 'linkedFieldValue' of PinkRoccade (V1) fields to the V2 option.
* Fields without a V2 counterpart (null or not listed) need to be linked manually after migrating.
*
* @since NEXT
*/
return array_merge(V1ToV2FieldMapping::base(), [
'verblijfplaats.straat' => 'verblijfplaats.verblijfadres.officieleStraatnaam',
'verblijfplaats.woonplaats' => 'verblijfplaats.verblijfadres.woonplaats',
'verblijfplaats.huisnummertoevoeging' => null,
]);
Loading