8000 Import may incorrectly match machineName to form.name · Issue #1951 · formio/formio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Import may incorrectly match machineName to form.name #1951

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

Open
JeroennC opened this issue Mar 25, 2025 · 1 comment
Open

Import may incorrectly match machineName to form.name #1951

JeroennC opened this issue Mar 25, 2025 · 1 comment

Comments

@JeroennC
Copy link

Describe the bug
We have issues where exporting and importing two forms with close identifiers are causing incorrect imports.

Version/Branch
9.3.1

To Reproduce
Steps to reproduce the behavior:

Example template/export:
Form A:

{
  "_id": "abc",
  "machineName": "test",
  "name": "this is my test",
}

Form B:

{
  "_id": "def",
  "machineName": "test2",
  "name": "test",
}

Form C:

{
  "components": [
    {
      "type": "form",
      "form": "test"
    } 
  ]
}

This indicates Form C has a nested form, nesting Form A. The values in exports are the machineName values.
When reimporting this Form C instead gets Form B as a nested form.

Expected behavior
After reimport, Form C should still contain Form A.

Additional context
I've dug through the code and believe this line to be the cause: https://github.com/formio/formio/blob/794cd8d92c54addc6742c612287d4d3e98bab348/src/templates/import.js#L1129C13-L1129C27

The code is not easy to follow so perhaps this is an oversight from me, but here it appears the model.name field is inserted into template.forms. Everywhere else in the code in this file, the entity.form === machineName is used to extract data from this template.forms object.

@olgabann
Copy link

Hi, @JeroennC. Thank you for reporting this issue. I am able to reproduce and have logged a ticket for the backlog. We are always willing to review any contributions from the open source community to resolve this issue.

For internal reference: FIO-9929

Also, we don't recommend changing the machineName because it can break the export/import

Monosnap.Video.2025-03-27.11.2.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0