mzur / kirby-form

A form helper for Kirby CMS based websites and apps, using the Post/Redirect/Get pattern.
MIT License
8 stars 6 forks source link

Handle nested data arrays #7

Closed nilshoerrmann closed 3 years ago

nilshoerrmann commented 3 years ago

If you are updating structure fields from the frontend using Kirby Uniform, content will be nested, e. g. <input name="structure[field][]" />. Therefore, the second level of the data array will also be an array. Currently, the form handler expects this to be a string and throws an error.

nilshoerrmann commented 3 years ago

I merged in the latest changes but I have no idea how to write a test case for this change.

mzur commented 3 years ago

You can duplicate this test and change the input data to nested arrays.

nilshoerrmann commented 3 years ago

Done!