Support

Account

Forum Replies Created

  • @ericaeide if you read the thread and are still unable to get it to work you’ll need to post the code you have so we can help.

  • John,

    I get that but it just seems weird that it happened to a handful of people when the version number changed. Granted my coding skills stink but it makes me think there is an error somewhere in ACF.

  • @hube2
    well it seems this did not solve my problem all it did was stop the function from working.

    This is the code I have… if i remark out the ‘remove action’ I get the loop error. If put it back it never actually works.

    //Auto add and update post content field:
      function my_post_content_updater( $post_id ) {
      
      // unhook this function to prevent infinite looping
      remove_action('acf/save_post', 'my_post_content_updater', 20);   
    
     
        $my_post = array();
        $my_post['ID'] = $post_id;
    
        $bluemovement           = get_field('bluemovement');
    
        if ( get_post_type() == 'bluemovement' ) {
          $my_post['post_content'] = get_field('bmd_organization_desc');
        } 
    
        // Update the post into the database
        wp_update_post( $my_post );
    
      }
       
    // run after ACF saves the $_POST['fields'] data
    add_action('acf/save_post', 'my_post_content_updater', 20);   

    Can we please poll Elliot on this as to why it all started with 5.2.9 ?

  • SOLVED!

    Holy cow, that was really all there was to it?

    Thanks so much. This does make me wonder what changed from 5.2.8 for this to suddenly start happening to so many uses.

  • Can someone help me out on mine? I am having the same loop issue when I upgraded to 5.2.9. I was hoping it would be resolved in 5.3 or 5.3.1 but it wasn’t. So I’m throwing it out there for some assistance.

    Thanks!
    jeffrey

    
    
    //Auto add and update Title field:
      function my_post_title_updater( $post_id ) {
    
        $my_post = array();
        $my_post['ID'] = $post_id;
    
        $bluemovement           = get_field('bluemovement');
    
        if ( get_post_type() == 'bluemovement' ) {
          $my_post['post_title'] = get_field('bmd_organization');
        } 
    
        // Update the post into the database
        wp_update_post( $my_post );
    
      }
    
       
    // run after ACF saves the $_POST['fields'] data
    add_action('acf/save_post', 'my_post_title_updater', 20);
    //END Auto add and update Title field:
    
     
      
    //Auto add and update post content field:
      function my_post_content_updater( $post_id ) {
    
        $my_post = array();
        $my_post['ID'] = $post_id;
    
        $bluemovement           = get_field('bluemovement');
    
        if ( get_post_type() == 'bluemovement' ) {
          $my_post['post_content'] = get_field('bmd_organization_desc');
        } 
    
        // Update the post into the database
        wp_update_post( $my_post );
    
      }
       
    // run after ACF saves the $_POST['fields'] data
    add_action('acf/save_post', 'my_post_content_updater', 20);   
     
    
    
  • I’m still waiting on a resolution to this. @mmjaeger Did you get it figured out?

  • I’ve removed all my custom functions and it is still broken. 5.30 also has the same effect.

  • I’ve attached two screen shots.
    In the second one, the Page title Projects. If I try to edit or save this in any way with 5.2.9 I get a server error.

    The Multi select is on the Project Page

    No problems with 5.28

  • Thanks, no fix yet, i moved it to the back burner. But I thank you for the follow-up and your past assistance with my woes. Which were all caused by that function cited above our responses.

  • Thanks, I ended up doing the following with some help from another coder.

    
    /* Grab Excerpt Function
    -----------------------------------------------------*/
    function grab_excerpt($str,$length=40,$append='...'){
        $pieces=explode(' ',strip_tags($str));
        $excerpt=implode(' ',array_slice($pieces,0,$length));
        if(count($pieces)>$length)
            $excerpt.=$append;
        return $excerpt;
    }
    

    Then put this in my template :
    <?php echo grab_excerpt($post_object->post_content); ?>

  • So my problem was a function I had setup. It was supposed to update the posts slug on save and it seems it was updating the field_key as a title slug as well.

    This is the code, if you have any suggestions how to make it only update posts and page slugs I’d love to hear it.

    // Updates slug from post title on Save
    function myplugin_update_slug( $data, $postarr ) {
        if ( !in_array( $data['post_status'], array( 'draft', 'pending', 'auto-draft' ) ) ) {
            $data['post_name'] = sanitize_title( $data['post_title'] );
        }
        return $data;
    }
    add_filter( 'wp_insert_post_data', 'myplugin_update_slug', 99, 2 );
  • I’ve been using this…give it a try

    //Auto add and update Title field:
      function my_post_title_updater( $post_id ) {
    
        $my_post = array();
        $my_post['ID'] = $post_id;
    
    // custom post type
        $foo           = get_field('foo');
    
        if ( get_post_type() == 'foo' ) {
          $my_post['post_title'] = get_field('acf_title_slug');
        } 
    
        // Update the post into the database
        wp_update_post( $my_post );
    
      }
       
      // run after ACF saves the $_POST['fields'] data
      add_action('acf/save_post', 'my_post_title_updater', 20);
    //END Auto add and update Title field:
  • John!!!!

    Thank you I owe you a great debt. I did as you suggested, I removed WordPress completely and reinstalled without that one plugin and things seems to be working!

    I honestly cannot believe that was causing issues even after I had disabled it or deleted it. Sigh…

    Again thank you!

  • I just setup a local copy of wordpress on my NAS

    installed acf and imported the json. I installed absolutely noting else and change no other settings and I have the exact same results.

    I deleted the import and set it up again and it works. so it is something with my server with hostgator I’m guessing

  • okay , it’s just one field to test at this point.
    i also put a ticket into hostgator to check for database permissions as this is such a weird issue.

  • I’ve deleted the validation plugin, went into the database and deleted everything I could find related to the ACF Group.

    Then recreated it and again, the problem is still there. I also went into the database after recreating the group and adding an entry and the entry does not show in the database.

  • Are you sure? Because like I said I disabled all the plugins and recreated the fields and it still wouldn’t work

  • @jonathan

    Update: I did a completely clean install of wordpress and ACF. I imported the fields via the json backup and I still have the exact same saving issue.

  • I am having the same problem and it’s making my crazy
    I too thought it was naming issue as some fields were not saving but now it doesn’t matter what they are named, some fields just won’t save any data.

    I ran table check and repair, my database show no errors.

    ACF Version 5.2.7
    WP 4.2.2

  • Very interesting.. it’s true, if the fields are hidden data is not saved.
    however if you had previously saved info in those fields it remains even if they are hidden on the next save.

  • Okay it’s solved. I have ‘org’ as part of the field name and it seems that might be reserved or something because as soon as I changed it things started working again.

  • I thought of doing it in the template but I did not want to have extraneous entries in the database.

    I’ll look into option #2 but my guess is that I’ll end up with going the template route.

    Thanks for the reply.

  • Hi John,

    It is a plain textarea inside a group.
    Here is a screenshot

    You might see some invalid fields showing, that is because I was running ACF Field Validation plugin but disabled in to try and diagnose this issue.

    More perplexing, after your response I created a new group with a single field being a text area and it worked. So I’m dumbfounded.

  • I guess we don’t count. ;(
    I had another post weeks ago that never got a response too.

  • Did you get this resolved? I’m trying to do something similar.. like this and I am totally lost with the needed syntax.

    <div>[a4e_spoiler title=”$get_sub_field_spoiler_title” class=”a4e-custom-spoiler”]
    <?php the_sub_field(‘spoiler_content’); ?>
    [/a4e_spoiler]</div>

Viewing 25 posts - 1 through 25 (of 43 total)