Title: Image array upload &gt; ACF not working
Last modified: June 22, 2024

---

# Image array upload > ACF not working

 *  Resolved [itsmir](https://wordpress.org/support/users/itsmir/)
 * (@itsmir)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/image-array-upload-acf-not-working/)
 * Hello,
   I’ve set up a form for front end Portfolio submissionsI have Portfolio
   custom post type with 2 custom fields (generated bu ACF). There are :
 * A color picker field (title_colour)
   A gallery field (job_images)
 * In the Forminator Form I did the following:-
 * Added upload field (upload-1)
   Added input field (text-1)Added PostData field (
   postdata-1)
 * In Postdata field I mapped 2 custom fields:
 * job_images > upload-1
   title_colour > text-1
 * The form submits without error.
   A Portfolio post is created & the uploaded images
   are added to the media librarycorrectly. However the job_images (gallery) field
   in the post is left unpopulated.Any tips gratefully received!

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Support [Nebu John – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport14/)
 * (@wpmudevsupport14)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/image-array-upload-acf-not-working/#post-17843630)
 * Hi [@itsmir](https://wordpress.org/support/users/itsmir/),
 * Sorry to know that you are experiencing an issue.
 * Wouldn’t you mind sharing an export of the Formiantior form along with the ACF
   field groups so that we can take a closer look at the issue and help you with
   a workaround?
 * I hope the following guide comes in handy:
    [https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export](https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export)
 * Please share the export file using Google Drive or Patebin.com in your next response.
 * We look forward to hearing back from you.
 * Kind Regards,
    Nebu John
 *  Thread Starter [itsmir](https://wordpress.org/support/users/itsmir/)
 * (@itsmir)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/image-array-upload-acf-not-working/#post-17844066)
 * Sure, thanks!
 * GDrive : [https://drive.google.com/drive/folders/1HPvmpABRgwWdnRmNyRlM0MirGhnz9bUS](https://drive.google.com/drive/folders/1HPvmpABRgwWdnRmNyRlM0MirGhnz9bUS)
 *  Plugin Support [Dmytro – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport16/)
 * (@wpmudevsupport16)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/image-array-upload-acf-not-working/#post-17844944)
 * Hello [@itsmir](https://wordpress.org/support/users/itsmir/),
 * Thank you for sharing the export file. Please test it after adding the following
   snippet as a [must use plugin](https://developer.wordpress.org/advanced-administration/plugins/mu-plugins/):
 * [https://gist.github.com/adczk/671c79c2ca431bbf79e4b638484c2436](https://gist.github.com/adczk/671c79c2ca431bbf79e4b638484c2436)
 * – paste the code in your text editor, and change ‘_mygal_‘ to ‘_job\_images_‘
   on line 22. On the next line please also change _16502_ to your form ID (same
   as in the form shortcode).
 * Save it as a PHP file, for example “_forminator-acf-gallery-postdata-upload-map.
   php_“, and upload to _/wp-content/mu-plugins/_ directory on the server.
 * Hope this code helps as a workaround, until the fix is implemented in the plugin.
   Please let us know if you have any questions.
 * Best Regards,
    Dmytro
 *  Thread Starter [itsmir](https://wordpress.org/support/users/itsmir/)
 * (@itsmir)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/image-array-upload-acf-not-working/#post-17848187)
 * Thanks for the code. I’ve set it up as mu plugin and tested. 
   The form now errors
   on submission – gallery/images upload field`This field is required. Please upload
   a file.`and yes, there are images added to that field. see screenshot : [https://drive.google.com/file/d/1Ip310C51Uqsq1VJfSV0NlFeYSCIsdfjV/view?usp=sharing](https://drive.google.com/file/d/1Ip310C51Uqsq1VJfSV0NlFeYSCIsdfjV/view?usp=sharing)(
   ignore lack of styling – just a-testing right now 😊 )
 *  Plugin Support [Laura – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support8/)
 * (@wpmudev-support8)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/image-array-upload-acf-not-working/#post-17848580)
 * Hi [@itsmir](https://wordpress.org/support/users/itsmir/)
 * Thanks for response!
 * That’s interesting actually – the added code should not affect how the field 
   works or uploads files; it’s executed later.
 * I just imported your custom fields and your form to my own test setup, added 
   suggested code and tested it and I couldn’t replicate such issue at all – it 
   worked just fine.
 * I’m wondering if this is the only custom code related to that form that you are
   getting. Is it or is there also something else? If there is other code – what
   is it?
 * Also, in the code itself, did you correctly set ACF field name and form ID in
   these lines?:
 *     ```
       $acf_fields = array( 'mygal' ); // set your ACF gallery fields names
       $form_ids = array( 16502 ); // set your form IDs
       ```
   
 * Is it happening regardless of the browser you are using or in some specific one(
   s) only and did you try with all other plugins except Forminator and ACF (and
   that custom code) disabled?
 * Kind regards,
    Adam
 *  Thread Starter [itsmir](https://wordpress.org/support/users/itsmir/)
 * (@itsmir)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/image-array-upload-acf-not-working/#post-17848888)
 * Did a little checking and the mu plugin works, but only for non-logged in users.
   I was testing whilst logged in and got the “required field” error. Tested in 
   incognito chrome & std edge as not logged in and all is OK. 
   So how do we get
   the mu-plugin work for logged in users?
 *  Thread Starter [itsmir](https://wordpress.org/support/users/itsmir/)
 * (@itsmir)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/image-array-upload-acf-not-working/#post-17848951)
 * **Update: ** if I’m logged in as me (admin) and the post-data field assigns the
   posts to me then the image upload error re: required field appears.
 *  If I’m logged in as me and the post-data field assigns the posts to another 
   user then the form submits correctly
 *  Plugin Support [Laura – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support8/)
 * (@wpmudev-support8)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/image-array-upload-acf-not-working/#post-17849328)
 * HI [@itsmir](https://wordpress.org/support/users/itsmir/)
 * Thanks for response!
 * That’s quite surprising and interesting finding, I must say.
 * There’s nothing in that MU plugin code that would be supposed to behave differently
   based on whether user is logged-in or not.
 * It should be the same for logged-in and logged-out users unless there’s something
   additional (like some other piece of custom code, or some specific setting on
   site that I’m missing or some other plugin) interfering.
 * Just to test something: if you remove the code entirely and then test submitting
   the same way – logged-in as you and logged-out – does it still show that error
   about required field or is it working fine then (I mean, the form submission 
   itself and the upload field, not the ACF mapping because that will not work without
   custom code anywyay)?
 * Best regards,
    Adam
 *  Thread Starter [itsmir](https://wordpress.org/support/users/itsmir/)
 * (@itsmir)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/image-array-upload-acf-not-working/#post-17854908)
 * Found a solution – unchecked the “Assign all posts to user” box in the Post-data
   field settings and now all users (logged in or out) can use the form with the
   MU plugin successfully. 
   I also updated ACF pro & elementor which could also 
   have fixed something – who knows. Anyway, many thanks for your help – will mark
   this resolved.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Image array upload > ACF not working’ is closed to new replies.

 * ![](https://ps.w.org/forminator/assets/icon-256x256.gif?rev=3443182)
 * [Forminator Forms – Contact Form, Payment Form & Custom Form Builder](https://wordpress.org/plugins/forminator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forminator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forminator/)
 * [Active Topics](https://wordpress.org/support/plugin/forminator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forminator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forminator/reviews/)

 * 9 replies
 * 4 participants
 * Last reply from: [itsmir](https://wordpress.org/support/users/itsmir/)
 * Last activity: [1 year, 11 months ago](https://wordpress.org/support/topic/image-array-upload-acf-not-working/#post-17854908)
 * Status: resolved