Support

Account

Home Forums ACF PRO acf_form image upload not showing in gallery

Solved

acf_form image upload not showing in gallery

  • Hi,

    We have a client website that uses ACF Pro to embed a form (using the acf_form() function) to create a ‘pending’ post for a custom post type that includes an image custom field. Anyone can submit this form (not just WordPress users).

    However, when a user that isn’t a logged in adds a photo, although the form is uploaded successfully, their image does not appear in the WordPress Media Library. However, you can view the image by getting the url on the image field (on the post itself).

    Our client pointed this out to us as they need to find that image in the gallery to add it to another field.

    We’re currently using WordPress 4.9.5 and ACF Pro 5.6.10. Deactivated all other plugins and changed the theme and the problem persists.

    Does anyone have any insight on this? The code for the form is below:

    <?php 
    
    acf_form_head(); 
    
    acf_form(array(
    'post_id' => 'new_post',
    'post_title'	=> true,
    'post_content'	=> true,
    'updated_message' => __("Thank you - Post Submitted", 'acf'),
    'submit_value' => __("Submit", 'acf'),
    'return' => '/',
    'fields' => array(
    'field_58f74273f440c',
    'field_58f74292f440d',
    'field_58f7697cf01f4',
    'field_58f742a0f440e',
    'field_58f742b7f440f',
    'field_59a93a00c446f',
    'field_5abcf82ba8b4f',
    ),
    'new_post' => array(
    'post_type' => 'event',
    'post_status'	=> 'pending'
    )
    
    ?>
  • UPDATE:

    I think I’ve narrowed this down to an issue with the uploader setting of the acf_form. When set to ‘wp’, WordPress’ own media library uploader it works fine. But when set to ‘basic’ (meaning the use of a general html file input element), it will not show the image in the media gallery grid layout – even if you were logged into WordPress when submitting the form.

  • I just wanted to keep this thread alive, a client of ours is experiencing the same issue. The weird thing is that you can see the uploaded file just fine if you are on the “List” view in the Media library, but not in the “Grid” view. But yes it has something to do with the ‘basic’ upload type in acf_form.

    Also, just for reference I am on the latest WP version (4.9.5) – I have a feeling it broke in either this version or 4.9.4, seeing as it seemed to become an issue right around beginning of April.

  • I would like to report that I’m experiencing the same issue. A front end ACF form is used to create a pending CPT and contains image fields. The uploaded images show up in the List view in Media Library but not in the Grid view. So they are successfully uploaded and for the most part very much the same as any other image – I’ve not been able to pinpoint the difference by looking in the database so far.

    Unfortunately switching the uploader to the ‘WordPress’ media uploader isn’t a good solution for this site because we don’t want the users to be able to browse and select images that are already in the Media Library.

    My client noticed it out for the same reason as OP’s client – they needed to add the image to another field. WordPress uses the Grid View for the Media Library that pops up when attaching images to fields or adding them to the WYSIWYG, so the images can’t be added to any other fields.

  • @gorillatyler @kisabelle

    Hi guys, I also created a ticket for this with ACF and it seems that they have found a fix!

    within the ACF plugin look for the file:

    /includes/api/api-helpers.php

    comment out line 3390:

    'context' => 'acf-upload'

  • Is this fix going to be implemented in an update, or do we have to edit the core plugin every time?

  • The fix has been implemented

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.