Support

Account

Home Forums Add-ons Repeater Field Added Repeater fields disappear

Solving

Added Repeater fields disappear

  • I have a repeater that contains 3 sub-fields that I created months ago. I would like to add 1 more sub-field to the list. When I add the sub-field to the repeater, it shows up fine on my page to add content to it, however when I click on “Update” to save the page, the content disappears from the newly created sub-field and I get no data in the PHP.

    I've tried changing my max_input_vars to 3000 which is more than enough and I still get the same results.

    I've experienced this in the past and had to completely remove the repeater field and recreate the whole thing with different names to get it working again, but in this case I'm using the repeater in many different places and would like NOT to have to re-create all repeater fields.

    Any help or suggestions?

  • Hi @grobear

    Can you please export your field group to XML and attach it to a comment?
    I’ll install it and take a look.

    Thanks
    E

  • Hi Elliot, I’m having the exact same problem as grobear, I’m attaching an export of the field group in question.

    I’m having the problem with the data not being saved on any repeater field group I create, downgraded the Repeater add on to 1.0.1 just to test and the problem persists. (I’m using 4.3.2 of the main plugin.)

    Regards, Anna

  • Here is my export. The field I was adding things to was the Content Block – tcwh_content_block, and I added the Hypderlink.

    Thanks!

  • After some more debugging I found the problem in my case: I’m using the _s theme which in inc/template-tags.php has these 2 actions:

    /**
     * Flush out the transients used in hotelflora_categorized_blog.
     */
    function _s_category_transient_flusher() {
    	// Like, beat it. Dig?
    	delete_transient( 'all_the_cool_cats' );
    }
    add_action( 'edit_category', '_s_category_transient_flusher' );
    add_action( 'save_post',     '_s_category_transient_flusher' );

    For whatever reason, removing those hooks fixed the problem (which turns out that it was that any and all save_post hooks weren’t being triggered) for me.

    Sorry for hijacking your thread @grobear, I hope you don’t mind. It’s just that we have the exact same problem. 🙂

  • Thats no problem @Anna.

    I’m not using any theme, I’ve built it from scratch, therefore I shouldn’t have any of those functions causing issues.

    Hope we can find a solution shortly 🙂

  • @grobear Just to rule it out, have you tried running something like

    add_action( 'save_post', 'foobar_function' );
    function foobar_function() {
    die('save_post triggered!');
    }

    , to make sure that save_post are being triggered as it should? 🙂

  • @Anna Yes, it does indeed get trigged when I hit update. 🙁 Still however doesn’t save the content.

  • And unfortunately it seems I spoke too soon about my own problem/solution; now save_post aren’t being triggered again for me… Argh! But for me that seems to be the problem atleast: the save_post action isn’t firing (in case someone else has this problem later on an reads this thread.)

  • Hi guys

    Before I test out any attached code, lets first rule out the possibility of your servers running our of memory / vars during the save proccess:

    Can you please read over these related threads and try to increase your php settings to allow more data to be saved?

    max_vars: http://support.advancedcustomfields.com/forums/topic/cant-add-more-to-repeater-item/

    name length: http://support.advancedcustomfields.com/forums/topic/field-group-doesnt-save-properly-when-using-both-repeater-and-flexible-cont/

    Thanks
    E

  • Sorry for the late reply.

    I’m feeling rather stupid now, but the problem for me has “magically gone away”… 😐 I haven’t touched the site in question for a day and returning to it today, the problem I was having with with save_post not being triggered in some themes but in others is gone.

    So it must have been some random, temporary issue with my environment (I’m flabbergasted, can’t for the life of me figure out what could have caused that rather odd and not the least inconsistent behaviour).

    Sometimes it seems “ignore it and it will go away” does work as a debugging tactic. -_- Sorry for all the fuss on my part!

  • @elliot I’ve done both of your requests with no success. Vars are high and server is not running out of memory.

  • Hi @grobear

    The last thing to do is debug the save function found in core/controllers/post.php on line 488.

    The function save_post will do some validation before running an action called ‘acf/save_post’.

    Step 1: Test that this function is getting past the validation and calling the action

    Next, head to the main acf.php file and on line 839, debug the save_post function there. This is what the post.php file was calling. Does this function loop through , load fields correctly and call the update_vlaue action?

    Hopefully you can find that there is something preventing the data from saving.

    Perhaps you will find that ACF is not getting through the $_POST[‘fields’] loop due to mem issues?

    Thanks
    E

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

The topic ‘Added Repeater fields disappear’ is closed to new replies.