Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing variables mapping in objects api registration (v2) #5150

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

robinmolen
Copy link
Contributor

@robinmolen robinmolen commented Mar 11, 2025

Closes #5031

Changes

The bug was already fixed by a previous PR (#5021). This PR adds a detection and a fix script, so that we can monitor and fix affected form registration backends.

Checklist

Check off the items that are completed or not relevant.

  • Impact on features

    • Checked copying a form
    • Checked import/export of a form
    • Config checks in the configuration overview admin page
    • Problem detection in the admin email digest is handled
  • Release management

    • I have labelled the PR as "needs-backport" accordingly
  • I have updated the translations assets (you do NOT need to provide translations)

    • Ran ./bin/makemessages_js.sh
    • Ran ./bin/compilemessages_js.sh
  • Dockerfile/scripts

    • Updated the Dockerfile with the necessary scripts from the ./bin folder
  • Commit hygiene

    • Commit messages refer to the relevant Github issue
    • Commit messages explain the "why" of change, not the how

@robinmolen robinmolen added the needs-backport Fix must be backported to stable release branch label Mar 11, 2025
Copy link

codecov bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.74%. Comparing base (5c42863) to head (111fd8f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5150   +/-   ##
=======================================
  Coverage   96.74%   96.74%           
=======================================
  Files         779      779           
  Lines       26774    26781    +7     
  Branches     3483     3486    +3     
=======================================
+ Hits        25903    25910    +7     
  Misses        607      607           
  Partials      264      264           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@robinmolen robinmolen force-pushed the bug/5031-missing-variables-mapping-in-objects-api-registration branch from b9561ea to aa57a72 Compare March 12, 2025 12:19
@sergei-maertens sergei-maertens changed the title Bug/5031 missing variables mapping in objects api registration Fix missing variables mapping in objects api registration (v2) Mar 12, 2025
…bjects API registrations

Due to a previously missing default value, some (older) Objects API registrations might not have `variables_mapping` in their `options` configuration. This causes issues when trying to configure variables to the Objects API, resulting in javascript errors.

This script ensures that all Objects API V2 registrations have, at least, an empty array as `options` `variables_mapping`.
Any form with an Objects API registration V2 (the variable mapping), that doesn't have `variables_mapping` in the `options` config, will have its `variables_mapping` set to empty array.

Due to a previously missing default value in the Objects API registration, the `options` value `variables_mapping` could be missing. If missing, this would cause javascript errors in during the variable mapping in the admin.
…_mapping options

When importing a form with an Objects API registration, that doesn't have a version, the version is set to 2.
And based on the version of the Objects API registration, a default value for `variables_mapping` is set.
@robinmolen robinmolen force-pushed the bug/5031-missing-variables-mapping-in-objects-api-registration branch from aa57a72 to 111fd8f Compare March 12, 2025 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-backport Fix must be backported to stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Variables tab crash after setting Objects API registration.
2 participants