Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flexible content with cloned repeater field is broken #936

Open
Dead-Man-Walker opened this issue Oct 28, 2024 · 1 comment
Open

Flexible content with cloned repeater field is broken #936

Dead-Man-Walker opened this issue Oct 28, 2024 · 1 comment

Comments

@Dead-Man-Walker
Copy link

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
@Dead-Man-Walker
Copy link
Author

Support asked me to check either the "Prefix Field Labels" or "Prefix Field Names" option of the cloned field, which did not resolve the issue. Setting a name and label for the cloned field, however, did fix this misbehavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant