AdvancedCustomFields / AdvancedCustomFields/acf

Nested Repeater Fields with Pagination Enabled Do Not Save Correctly

Open
#963 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
945
Forks
197
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
When two nested ACF fields (both of type Repeater) have the option "pagination": 1 enabled, the inner field content is no longer saved correctly. The data appears to be lost or overwritten during save.

To Reproduce
Steps to reproduce the behavior:

  1. Create a Repeater field (Parent Repeater).
  2. Inside this field, add another Repeater field (Child Repeater).
  3. Enable "pagination": 1 for both Repeater fields.
  4. Add content to both fields in the WordPress backend.
  5. Save the post.
  6. Reopen the post and check the values — the inner Repeater content is missing or not saved correctly.

Expected behavior
The values entered in both nested Repeater fields (with pagination enabled) should be saved and displayed correctly after saving the post.

Screenshots or Video
N/A — the issue is data-related and occurs upon save.

Code
You will find attached the exported JSON of the relevant ACF field group that reproduces the issue. (Attach your JSON export when submitting the ticket.)

Version Information:

  • WordPress Version: 6.8.1
  • ACF PRO Version: 6.4.2
  • PHP Version: 8.1.x
  • Browser: Chrome (latest)

JSON:

{
    "key": "group_5e67884841724",
    "title": "Fieldgroup XYZ",
    "fields": [
        {
            "key": "field_5e67889ad8b2a",
            "label": "Flexible Content",
            "name": "flexible_content",
            "aria-label": "",
            "type": "flexible_content",
            "instructions": "",
            "required": 0,
            "conditional_logic": 0,
            "wrapper": {
                "width": "",
                "class": "",
                "id": ""
            },
            "allow_in_bindings": 0,
            "wpml_cf_preferences": 2,
            "admin_only": 0,
            "exclude_customer": 0,
            "layouts": {
                "layout_6604371afv5cd7": {
                    "key": "layout_6604371afv5cd7",
                    "name": "layout_xyz",
                    "label": "Layout XYZ",
                    "display": "block",
                    "sub_fields": [
                        {
                            "key": "field_68042e0594df7",
                            "label": "Repeater 1",
                            "name": "repeater_1",
                            "aria-label": "",
                            "type": "repeater",
                            "instructions": "",
                            "required": 0,
                            "conditional_logic": 0,
                            "wrapper": {
                                "width": "",
                                "class": "",
                                "id": ""
                            },
                            "allow_in_bindings": 0,
                            "wpml_cf_preferences": 2,
                            "admin_only": 0,
                            "exclude_customer": 0,
                            "collapsed": "",
                            "pagination": 0,
                            "min": 1,
                            "max": 0,
                            "layout": "block",
                            "button_label": "Add Item Repeater 1",
                            "rows_per_page": 20,
                            "sub_fields": [
                                {
                                    "key": "field_66265bd4e88e9",
                                    "label": "Repeater 2",
                                    "name": "repeater_2",
                                    "aria-label": "",
                                    "type": "repeater",
                                    "instructions": "",
                                    "required": 0,
                                    "conditional_logic": 0,
                                    "wrapper": {
                                        "width": "",
                                        "class": "",
                                        "id": ""
                                    },
                                    "allow_in_bindings": 0,
                                    "admin_only": 0,
                                    "exclude_customer": 0,
                                    "collapsed": "",
                                    "pagination": 0,
                                    "min": 1,
                                    "max": 10,
                                    "layout": "row",
                                    "button_label": "Add Item Repeater 2",
                                    "rows_per_page": 20,
                                    "parent_repeater": "field_68042e0594df7",
                                    "sub_fields": [
                                        {
                                            "key": "field_662b9e12d3a7f",
                                            "label": "Media-File",
                                            "name": "media_file",
                                            "aria-label": "",
                                            "type": "file",
                                            "instructions": "",
                                            "required": 1,
                                            "conditional_logic": 0,
                                            "wrapper": {
                                                "width": "50",
                                                "class": "",
                                                "id": ""
                                            },
                                            "allow_in_bindings": 0,
                                            "wpml_cf_preferences": 2,
                                            "admin_only": 0,
                                            "exclude_customer": 0,
                                            "return_format": "array",
                                            "preview_size": "thumbnail",
                                            "library": "all",
                                            "min_width": "",
                                            "min_height": "",
                                            "min_size": "",
                                            "max_width": "",
                                            "max_height": "",
                                            "max_size": "",
                                            "mime_types": "mp3",
                                            "parent_repeater": "field_66265bd4e88e9"
                                        }
                                    ]
                                }
                            ]
                        }
                    ],
                    "min": "",
                    "max": ""
                }
            },
            "button_label": "",
            "min": "",
            "max": ""
        }
    ],
    "location": [
        [
            {
                "param": "post_type",
                "operator": "==",
                "value": "page"
            }
        ]
    ],
    "menu_order": 1,
    "position": "normal",
    "style": "default",
    "label_placement": "top",
    "instruction_placement": "label",
    "hide_on_screen": "",
    "active": true,
    "description": "",
    "show_in_rest": 0,
    "modified": 1750158065
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied nested Repeater JSON and reproduce the save flow in the WordPress backend using pagination on both Repeater fields. Compare the nested values before saving and after reopening the page; done means inner Repeater content is retained and displayed correctly. No source file or test is named in the issue, so locating the relevant save path and adding regression coverage will require project research.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.