verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
95 stars 73 forks source link

Editing form fields handle does not sync in email notifications #668

Open romainpoirier opened 2 years ago

romainpoirier commented 2 years ago

Description I have renamed some fields handle, and while they get saved correctly, their content is missing in email notifications. That's like the variables we can use (using the + icon) are based on the handle and not on the id of the field. This is a painful with a lot of variables in multiples emails: the correction has to be done manually. After edit, it works again. Sometimes, using groups and (or maybe conditions), the child fields are also ignored even if it's only the parent handle that have been changed.

Maybe I should open another ticket for that, but I also noticed that changing the handle of fields can also break the conditions in the form setup (even more possible when using groups).

Form settings

Additional info

engram-design commented 2 years ago

This is a known issue and working on a migration path to handle this. It was probably wishful thinking to use handles for the variable tokens, as we need to pick something more solid however using the IDs isn't going to be a solution going forward either, because we're introducing import/export behaviour in 1.5.0, which means that the IDs for a field on one environment won't always be the same on another environment, because fields aren't stored in the project config, like they are for your sections, etc.

We might need to address this by updating references to old field handles, in the few places they're used (variable tokens, conditions, etc).

romainpoirier commented 2 years ago

Ok thank you for these explanations, I understand. Probably a silly suggestion, but maybe a new reference column which get a unique id that doesn't change from one env to another one would do the job.

engram-design commented 2 years ago

Yep, that's what I was thinking, or even experimenting with the UID when it comes to import/export. Whatever this instance, we'll have to run a migration for "all the things".