AdvancedCustomFields / AdvancedCustomFields/acf
Gutenberg block with clone field doesn't show default value
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
When I add a block in the Gutenberg editor that contains a "clone" field, its value is shown only when I change something in any field.
ACF Group fields:
- section_appearance (group), subfields:
- background (select, defalut: "white")
- bottom_border (true/false, default: false)
- section, fields:
- appearance (clone of the "section_appearance", display: Seamless)
Template added with the acf_register_block function:
echo "appearance:\n";
print_r(get_field('appearance'));
echo "section_appearance:\n";
print_r(get_field('section_appearance'));
?>
What I see after adding a block in the editor:
appearance:
section_appearance:
Array
(
[field_60fe956ea9e15] => white
[field_60fe95cda9e16] => 0
)
What I see when I change something in any input and after block view is refreshed:
appearance:
Array
(
[section_appearance] => Array
(
[background] => white
[bottom_border] =>
)
)
section_appearance:
Array
(
[background] => white
[bottom_border] =>
)
Versions:
WP 5.7.2
ACF Pro 5.9.8
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the acf_register_block template and the listed ACF Group, clone, select, and true/false fields on WordPress 5.7.2 with ACF Pro 5.9.8. Compare the initial block render with the render after changing an input; done means the clone field returns and displays its default values immediately after the block is added.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100