paulpif
Forum Replies Created
-
Hi Adam,
Many thanks indeed for your helpful response. I’ve implemented your suggestion:
Replace add_filter( 'forminator_replace_form_data', function ($content, $data, $fields, $original_content) { line with add_filter( 'forminator_replace_form_data', function ($content, $data, $original_content) {
This appears to have fixed the issue we were having and our site seems to be operating ok now on version 1.16.2 of Forminator – with the above implemented into our additional custom code.
Many thanks for your kind and timely help.
Kind regards
Paul
Hi Pawel,
Many thanks for your reply.
I’ve added a snipped of the code where the error seems to be occurring, here:
I have inspected the code and I think the issue is due something to do with line 33 (
– the: add_filter( ‘forminator_replace_form_data’, function ($content, $data, $fields, $original_content) – which it look like i need to remove the ‘$fields’ variable, but i’m not sure how this will affect the code (i didnt write this code, and am rather inexperience with this coding).I’d really appreciate your advise.
Kind regards
Paul
Many thanks indeed Adam, was great to get this working. I now have a better insight into what’s going on with the code too. (wonder if there is any documentation online that shows this API hook in more detail? No worries if not), i Really appreciate the kind assistance from yourself and your team.
Also, Just notice a typo in my last reply – clearly it ought to say ‘..and the file is *now* uploading successfully to the CPT….’, just for the benefit of any community members that may find this post useful in the future…
Best regards
Paul
Hi, that’s really helpful. Adding this code as an MU plugin seems to have done the tick and the image file is not uploading successfully to the CPT field.
Many thanks indeed.
Now all I need to do is migrate the code out from the MU to my main plugin code. I wonder if you have any further advise or things I should be aware of when I do this.
Best regards
Paul
Sure, here is a link to exported form JSON:
(a bit of background, that might help – i originally was testing on a staged version my our site and needed to export this form from there to our live version of the site – so this version of the form is derived/created from an exported/imported form).
I have to say, i’m wondering if something change with the form once id exported and imported to my live site, as I’ve experience some ‘weird’ behaviour that I was not experiencing on the original on the staged site version.
I also wonder if it helps to see the CPT export file; so here that is too:
https://www.dropbox.com/s/ogw6pl6hp29dnd9/acf-export-2022-02-11.json?dl=0
Best regards
Paul
- This reply was modified 2 years, 9 months ago by paulpif.
Hi Demitris, many thanks for the kind and timely reply.
I’ve implemented the above, but the uploaded file is still not being attached to the CPT record. The Image upload field still appears to be empty upon submitting the form.
Best regards
Paul