AdvancedCustomFields / AdvancedCustomFields/acf

Flexible content with cloned repeater field is broken

Open
#936 1 comment 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 populating fields of a cloned repeater field within a flexible content layout and saving the page, the contents of those fields are lost after a page reload, leaving you with one empty item of the repeater within the flexible layout content.

To Reproduce
Steps to reproduce the behavior:

  1. Create field group A consisting of:

Repeater

WYSIWYG-Editor

  1. Create field group B consisting of:

Flexible Content

  1. Layout

Clone -> "All fields of field group A"

  1. Assign field group B to all pages
  2. Create a page and navigate to assigned field group B
  3. Field group B: Add entry -> field group A
  4. Add N WYSIWYG items of the repeater and fill with dummy content
  5. Save page and wait for reload (in admin area)
  6. The contents of all WYSIWYG items is gone and only one empty repeater item is left

Expected behavior
The contents of all WYSIWYG items are shown and editable (in admin area)

Screenshots or Video
If applicable, add screenshots or video to help explain your problem.

Code
Field group A:
{ "key": "group_671f6cf3816b6", "title": "field-group-a", "fields": [ { "key": "field_671f6cf454395", "label": "field-group-a", "name": "field-group-a", "aria-label": "", "type": "repeater", "instructions": "", "required": 0, "conditional_logic": 0, "wrapper": { "width": "", "class": "", "id": "" }, "layout": "table", "pagination": 0, "min": 0, "max": 0, "collapsed": "", "button_label": "Eintrag hinzufügen", "rows_per_page": 20, "sub_fields": [ { "key": "field_671f6d3054396", "label": "field-group-a-text", "name": "field-group-a-text", "aria-label": "", "type": "wysiwyg", "instructions": "", "required": 0, "conditional_logic": 0, "wrapper": { "width": "", "class": "", "id": "" }, "default_value": "", "allow_in_bindings": 0, "tabs": "all", "toolbar": "full", "media_upload": 1, "delay": 0, "parent_repeater": "field_671f6cf454395" } ] } ], "location": [ [ { "param": "post_type", "operator": "==", "value": "post" } ] ], "menu_order": 0, "position": "normal", "style": "default", "label_placement": "top", "instruction_placement": "label", "hide_on_screen": "", "active": true, "description": "", "show_in_rest": 0, "modified": 1730116973 }
Field group B:
{ "key": "group_671f6d641d827", "title": "field-group-b", "fields": [ { "key": "field_671f6d64ace56", "label": "field-group-b", "name": "field-group-b", "aria-label": "", "type": "flexible_content", "instructions": "", "required": 0, "conditional_logic": 0, "wrapper": { "width": "", "class": "", "id": "" }, "layouts": { "layout_671f6d71dd42a": { "key": "layout_671f6d71dd42a", "name": "layout1", "label": "layout1", "display": "block", "sub_fields": [ { "key": "field_671f6dcdace59", "label": "", "name": "", "aria-label": "", "type": "clone", "instructions": "", "required": 0, "conditional_logic": 0, "wrapper": { "width": "", "class": "", "id": "" }, "clone": [ "group_671f6cf3816b6" ], "display": "group", "layout": "block", "prefix_label": 0, "prefix_name": 0 } ], "min": "", "max": "" } }, "min": "", "max": "", "button_label": "Eintrag hinzufügen" } ], "location": [ [ { "param": "post_type", "operator": "==", "value": "diir-newsletter" } ] ], "menu_order": 0, "position": "normal", "style": "default", "label_placement": "top", "instruction_placement": "label", "hide_on_screen": "", "active": true, "description": "", "show_in_rest": 0, "modified": 1730116948 }

Version Information:

  • WordPress 6.6.2
  • PHP 8.0.3
  • ACF PRO 6.3.6
  • Firefox 131.0.3

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 by reproducing the reported configuration in the WordPress admin: a cloned repeater with a WYSIWYG subfield inside a flexible-content layout, then save and reload the page. No source file or test is named; the fix is complete when all repeater items and their WYSIWYG contents remain visible and editable after reload.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
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.