Pro form File Upload + Metabox image custom fields

Hi!

I’m trying to upload images on a post creation with ProForm. The image is uploaded in the medias folder, but is not ‘linked’ to my new post. In my CPT i’m using Metabox ‘image’ custom field types (image, image_advanced, single_image or image_upload). When saving a post in database, Metabox uses the image post_ID as the meta value. Pro form set the image URL as the value.

Am i doing something wrong?

I had the same issue.

Daniel told me this:

The better way to go here is to let Bricksforge first create the post, THEN update the post meta of the new created post. For this, I’ve added a new “Post Meta Action” to your form. There, I set the Post ID to {{live_post_id}} . This means that the new created ID of the previous action should be used.

This works for me perfectly.

Hi @olpo ,

Can you, please, show me an exemple of your ProForm parameters for the update meta action, because i can’t get it work? I don’t anderstand how to get the image ID instead of url on the update meta action…

Thanks in advance.

Hi @Drakking,

“anzeigen_bilder” is the field name of the custom metabox image field.
Hope that helps.

@olpo ,

I guess {{bilder_upload}} is your form upload field ID? Or it a custom dynamic data tag?

If it’s the form field ID, I tried with and without brackets, it doesn’t work.

If I put a fixed ID (corresponding to an existing image in my media library), it works…

yes {{bilder-upload}} is my custom ID for the file upload field:
image

Hmm… sadly I have no idea why it’s not working for you :frowning:
Just a stupid thought: Have you removed the image upload from the create post action?

I tested with and without upload from create post action, same result. No meta value inserted in the database. Strange behaviour. I mean, when i set the image upload in the create post action with no meta update action, bricksforge inserts a row in the database with the right field key but image url as the value.Oddly, when i set the meta update action (with or without image upload on create action), bricksforge doesn’t insert any meta field row in database…

@Daniele help!

Anyone to give me some advices??

Could you send me login data via DM with some instructions where I can find your form? :slight_smile:

Hi Daniel, DM sent.

Just took a closer look and found the problem. It was caused by the fact that in your website, Metabox AND JetEngine as well is installed. I do some plugin checks to know which image format Pro Forms should use to save the values. JetEngine is needing urls, while Metabox needs IDs. In your case, Pro Forms choosed the JetEngine way.

I’ve updated the conditions now to be more strict and work also when both plugins are installed on a site. Should work now :slight_smile: