Trying to make sense of a FAQ, https://www.chronoengine.com/faqs/72-ccv5/5238-how-to-use-file-uploads-in-my-edit-form.html, to make it work in my application.
I'm utilizing CC5 and CF5. I have a connection named schools with a model named sdata. In my list actions edit is linked to the form 518schools-edit. In the form is a file upload field named logo. I need to be able to use the file upload field to add or update a logo image and save the file name to the logo field.
In the form in the on submit section I have a File Upload event (which works) followed a Connection Action configured per the FAQ's. It updates all the other fields, but the logo field doesn't update.
Per your FAQ, mentioned above, I tried renaming the field as sdata[logo] and sdata:logo.
I'm not clear on where to do the following because I'm not finding the "Array fields" box.:
"Then you will need to write "Model" in the "Arrays fields" box in order to handle all the file fields under the Model key."
I've also tried to figure out the alternative method mentioned in the FAQ:
Another solution would be to remove the Model name from the file field (e.g: field1) and use that in the file uploads action settings, but then you will have to move the value of the field under the Model key in the data array using PHP:
I'm not sure where to place the following: $form->data["sdata"]["logo"] = $form->data["logo"];
Any help is appreciated.
I'm utilizing CC5 and CF5. I have a connection named schools with a model named sdata. In my list actions edit is linked to the form 518schools-edit. In the form is a file upload field named logo. I need to be able to use the file upload field to add or update a logo image and save the file name to the logo field.
In the form in the on submit section I have a File Upload event (which works) followed a Connection Action configured per the FAQ's. It updates all the other fields, but the logo field doesn't update.
Per your FAQ, mentioned above, I tried renaming the field as sdata[logo] and sdata:logo.
I'm not clear on where to do the following because I'm not finding the "Array fields" box.:
"Then you will need to write "Model" in the "Arrays fields" box in order to handle all the file fields under the Model key."
I've also tried to figure out the alternative method mentioned in the FAQ:
Another solution would be to remove the Model name from the file field (e.g: field1) and use that in the file uploads action settings, but then you will have to move the value of the field under the Model key in the data array using PHP:
I'm not sure where to place the following: $form->data["sdata"]["logo"] = $form->data["logo"];
Any help is appreciated.