Skip to content

Commit

Permalink
Merge pull request #5128 from open-formulieren/release/3.0.5
Browse files Browse the repository at this point in the history
Patch release 3.0.5
  • Loading branch information
robinmolen authored Mar 3, 2025
2 parents 4b1ecdf + c789e3c commit 2df7c56
Show file tree
Hide file tree
Showing 12 changed files with 969 additions and 782 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[bumpversion]
commit = False
tag = False
current_version = 3.0.4
current_version = 3.0.5
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<pre>[a-z]+)\.(?P<build>\d+))?
serialize =
{major}.{minor}.{patch}-{pre}.{build}
Expand Down
2 changes: 1 addition & 1 deletion .sdk-release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.0
3.0.1
30 changes: 30 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,36 @@ Changelog

The Dutch version of this changelog can be found :ref:`here <changelog-nl>`.

3.0.5 (2025-03-03)
==================

Regular bugfix release.

.. warning:: Manual intervention required

We fixed a bug that would mess with the validation of the soft-required components.
A script is included to fix the forms that are affected - you need to run this
after deploying the patch release.

.. code-block:: bash
# in the container via ``docker exec`` or ``kubectl exec``:
python src/manage.py /app/bin/fix_softrequired_component_required_validation.py
Alternatively, you can also manually edit all the affected forms in the
admin interface. Simply edit the soft-required components by opening the ``JSON`` view
and within the ``validate`` key change ``required: true`` to ``required: false``.

**Bugfixes**

* [:backend:`5086`, :backend:`5090`] Fixed soft-required errors being shown for hidden
upload fields and blocking going to the next form step.
* [:backend:`5039`] Fixed some error messages not shown properly in the Email
Registration plugin.
* Worked around some performance issues while evaluating form logic.
* [:backend:`5089`] Fixed service fetch configuration automatically changing from
snake-case to camel-case.

3.0.4 (2025-02-06)
==================

Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ COPY \
./bin/check_temporary_uploads.py \
./bin/check_api_groups_null.py \
./bin/fix_selectboxes_component_default_values.py \
./bin/fix_softrequired_component_required_validation.py \
./bin/

# prevent writing to the container layer, which would degrade performance.
Expand Down
2 changes: 1 addition & 1 deletion README.NL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Open Formulieren
================

:Version: 3.0.4
:Version: 3.0.5
:Source: https://github.com/open-formulieren/open-forms
:Keywords: e-Formulieren, Common Ground, FormIO, API

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Open Forms
==========

:Version: 3.0.4
:Version: 3.0.5
:Source: https://github.com/open-formulieren/open-forms
:Keywords: e-Formulieren, Common Ground, FormIO, API

Expand Down
66 changes: 66 additions & 0 deletions bin/fix_softrequired_component_required_validation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/usr/bin/env python
#
# Fix the validation set on soft-required components.
#
# Due to a bug in the global configuration, the validation for soft-required components
# could be set to `required: true`. This causes the form to be in-completable, as the
# user cannot provide a value for the soft-required component.
# The problem in the global configuration has been fixed, so new soft-required component
# won't have this issue.
#
# This script automatically fixes the validation rules of all soft-required components.
# Related to ticket: https://github.com/open-formulieren/open-forms/issues/5090
from __future__ import annotations

import sys
from pathlib import Path

import django

SRC_DIR = Path(__file__).parent.parent / "src"
sys.path.insert(0, str(SRC_DIR.resolve()))


def fix_softrequired_required_validation() -> None:
from django.db.models import Q

from openforms.forms.models import FormDefinition

form_definitions_to_update = []
fds = FormDefinition.objects.iterator()
for form_definition in fds:
# Flag to update Form Definition. Is set when child component is changed
should_persist_fd = False

for component in form_definition.iter_components():
# The fix is only needed for softRequiredErrors components
if component["type"] != "softRequiredErrors":
continue

# Only fix components with the required validation set to True
if not component["validate"].get("required", False):
continue

component["validate"]["required"] = False
# Set flag to update Form Definition
should_persist_fd = True

if should_persist_fd:
form_definitions_to_update.append(form_definition)

FormDefinition.objects.bulk_update(
form_definitions_to_update, fields=["configuration"]
)


def main(**kwargs):
from openforms.setup import setup_env

setup_env()
django.setup()

return fix_softrequired_required_validation(**kwargs)


if __name__ == "__main__":
main()
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openforms",
"version": "3.0.4",
"version": "3.0.5",
"description": "Open Forms",
"main": "src/static/openforms/js/openforms.js",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion publiccode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ publiccodeYmlVersion: '0.2'
name: Open Forms Builder and API
url: 'http://github.com/open-formulieren/open-forms.git'
softwareType: standalone/backend
softwareVersion: 3.0.4
softwareVersion: 3.0.5
releaseDate: '2022-03-10'
logo: 'https://github.com/open-formulieren/open-forms/blob/master/docs/logo.svg'
platforms:
Expand Down
2 changes: 1 addition & 1 deletion src/openforms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .celery import app as celery_app

__all__ = ("celery_app",)
__version__ = "3.0.4"
__version__ = "3.0.5"
__author__ = "Maykin Media"
__homepage__ = "https://github.com/open-formulieren/open-forms"
Loading

0 comments on commit 2df7c56

Please sign in to comment.