I am currently working on a front end repeating image uploader for user profiles. The majority of this works fine and correctly saves the information. However, REGARDLESS of what capabilities I give to the user, the upload will fail on any user level below an editor.
I realize that this might not be an ACF question specifically but am hoping that it is. Any help would be appreciated!
Have you tried absolutely every capability?
Perhaps you have an error in the returned AJAX data when uploading? Have you checked your console log for this?
Perhaps you have a filter / action which is stopping the uploading uploader / wp admin depending on the user?
I’ve tried every capability, checked the console log and there are no errors and nothing that stands out of the ordinary. The only thing I can think of is that there is SOME conflict with the ‘Theme My Login’ plugin. ACF doesn’t natively integrate with the plugin and I have to use the ACF front end form function to correctly display the form and some action hooks to save the data. This will work when the user role is admin or editor but none other.
On further investigation, this issue does NOT have to do with the Theme My Login plugin.
My code for the template is below. Could there be something wrong with it?
<?php /** * Template Name: Profile Downloads * ============================================== * This template is responsible for managing the * each user's downloads. Let's see how this goes * * @author carvache * @date 8/30/2014 */ // Preprocessing Logic if ( !is_user_logged_in() ) exit('You must login to see this page'); acf_form_head(); get_header(); ?> <div class="content-wrapper"> <div class="page-wrapper"> <div class="gdl-page-float-left"> <div class="gdl-page-item"> <div class="sixteen columns mt 30"> <h1 class="gdl-page-title gdl-divider gdl-title title-color"><?php the_title() ?></h1> <?php acf_form(array( 'post_id' => 'user_' . get_current_user_id(), 'field_groups' => array(600), // the ID of the field group 'updated_message' => '', // default updated message. Can be false to show no message 'form' => true )); ?> </div> </div> </div> </div> </div> <?php get_footer();
Thanks so much. Any way I can help you with this?
Test changing the post_id param to an int. Does the form now work as expected?
Just tried the new v4.3.0 from github. This unfortunately didn’t solve this. If its all the same to you, here’s a blow by blow of what’s happening.
See attached screenshot. Thanks in advance for helping!
It is possible that your issue is a unique one. Are you able to turn on DEBUG MODE in your wp-config.php file, then jump back to the front end form and refresh your browser, open up your console log and test the upload again.
After the image fails to upload, you should see the ajax call in the console log and you can review the returned HTML. What are the error messages?
I had a similar problem with ACF 4.2.2, then i updated to 4.3.0 and it was fixed. See here:
After a few days, and i don’t know why, i was getting the same problem again. This time i found that TML’s Themed Profiles module is causing this (which is weird because it was activated before).
This thread solved my problem, and it might help you:
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
🙋♂️ We are researching for our upcoming website redesign and would love to showcase some brands/agencies of popular or well known websites that use ACF.— Advanced Custom Fields (@wp_acf) October 11, 2019
If you have worked on, or know of any websites that would suit, please comment below.#WordPress
© 2019 Advanced Custom Fields. Subscribe