Support

Account

Home Forums Backend Issues (wp-admin) acf_add_local_field_group repeater saves no more than 142 fields

Solved

acf_add_local_field_group repeater saves no more than 142 fields

    • kontur

    • October 3, 2019 at 6:25 pm

    Hey,

    I’ve implemented a repeater field (with 5 sub fields) and there is some odd behavior. After working flawlessly for a long while, it appears that adding more then 142 fields to this group fails to save.

    My field definition looks something like this:

    if( function_exists('acf_add_local_field_group') ):
    
    acf_add_local_field_group(array(
    	'key' => 'group_5c92091aba937',
    	'title' => 'Font links',
    	'fields' => array(
    		array(
    			'key' => 'field_5c92094c02fef',
    			'label' => 'Font links',
    			'name' => 'font_links',
    			'type' => 'repeater',
    			'instructions' => '…',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array(
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'collapsed' => '',
    			'min' => 0,
    			'max' => 0,
    			'layout' => 'table',
    			'button_label' => '',
    			'sub_fields' => array(
    				… the sub fields …
    			),
    		),
    	),
    	'location' => array(
    		array(
    			array(
    				'param' => 'options_page',
    				'operator' => '==',
    				'value' => 'fontlinks',
    			),
    		),
    	),
    	'menu_order' => 0,
    	'position' => 'normal',
    	'style' => 'default',
    	'label_placement' => 'top',
    	'instruction_placement' => 'label',
    	'hide_on_screen' => '',
    	'active' => true,
    	'description' => '',
    ));
    
    endif;

    I can see the fields in the backend in the wp_options table being added up until that field id.

    Also I added actions/filters to all of these:

    acf/save_post
    acf/update_value
    acf/input/admin_head
    updated_option
    added_option

    and the only one that does trigger when saving the option group in the admin is the acf/input/admin_head.

    The notice in the head after updating read “Options Updated.” although nothing is saved for rows after 142.

    There are no entries in debug.log except “Headers already sent” warnings generated by my debug output in the head, nothing otherwise.

    Is this an issue with ACF, WP options, the DB? Any clues or things to test next?

    Cheers,
    Johannes

    • kontur

    • October 7, 2019 at 5:48 pm

    Thanks John, that was it. It’s hard to search for this issue and find that help article, but I don’t know what I would suggest to make it more discoverable, either 🙂

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.