arnoson / kirby-forms

Form builder and handler for Kirby 4
MIT License
10 stars 3 forks source link

Usage on multi-language sites #8

Closed n-kort closed 1 year ago

n-kort commented 1 year ago

Hey, thanks for this plugin! It works really well so far but I'm having some issues with multi-language sites.. perhaps there is something I missed in the setup?

Building a form page in the default language is problem-free, but I can't make any edits in different languages. Trying to to save anything results in:

Screenshot 2023-06-10 at 18 41 46

and looking at the data in the content folder, it looks like all the 'name' keys have been deleted from the Form-fields structure. The Identifier field is empty, disabled but required:

Screenshot 2023-06-10 at 18 43 04

"Create from label" is also disabled. Going into the txt file and manually adding name keys does re-enabled saving/editing on those other languages...

arnoson commented 1 year ago

Glad you like the plugin and thanks for the detailed issue! I never tried it with muli-language sites, I'll have a look at it next week

arnoson commented 1 year ago

The problem was that I disabled translation for the identifier (which makes sense, because the identifier should be the same in all languages). But when you create a new form field in the non-default language, you need to be able to set the identifier, which should now work!

Ideally, Kirby should either sync block content properly, which would solve the problem without making the identifier translatable, or this plugin should handle it, so that you can only add new form fields in the default languages, which will then automatically appear in all other languages with the identifier already set.

n-kort commented 1 year ago

Amazing, thank you!