formie icon indicating copy to clipboard operation
formie copied to clipboard

[3.x]: Import: updating existing form generate a error

Open Megafry opened this issue 1 year ago • 3 comments

Describe the bug

The Import generates an error if the option updating existing form is selected.

in /var/www/html/vendor/verbb/formie/src/helpers/ImportExportHelper.php:221 Undefined array key "handle"

$existingField = $existingFields[$field['handle']] ?? null;

Fix:

221: $existingField = $existingFields[$field['settings']['handle']] ?? null;
...
232: $existingNestedField = $existingFields[$field['settings']['handle'] . '_fields'][$nestedField['handle']] ?? null;

After retrying the import with the fix, my form had 2 pages named "Page 1" therefore I could not test with group/repeater fields.

Steps to reproduce

  1. Export a form
  2. Import the form with the Action "Update existing form"
  3. CraftCMS generates an exception

Form settings

  • Backend only

Craft CMS version

5.2.5

Plugin version

3.0.0-beta.16

Multi-site?

No response

Additional context

No response

Megafry avatar Jul 06 '24 16:07 Megafry

Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-5 as 3.0.0-beta.16".

engram-design avatar Jul 08 '24 00:07 engram-design

Thanks for fixing the error, the problem with the duplicate pages is still present, can you also have a look at this?

image

Megafry avatar Jul 08 '24 18:07 Megafry

Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-5 as 3.0.0-beta.16".

engram-design avatar Jul 09 '24 00:07 engram-design

Fixed in 3.0.0-beta.17

engram-design avatar Jul 16 '24 22:07 engram-design