[3.x]: Import: updating existing form generate a error
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
- Export a form
- Import the form with the Action "Update existing form"
- 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
Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-5 as 3.0.0-beta.16".
Thanks for fixing the error, the problem with the duplicate pages is still present, can you also have a look at this?
Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-5 as 3.0.0-beta.16".
Fixed in 3.0.0-beta.17