WYSIWYG fields in ACF Blocks don't save without switching to Preview first
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
调研方向
检查 acf-pro-blocks.js,尤其是 BlockForm.componentDidAppend() 及其对 change/key-up 的处理。在 Gutenberg 编辑器中复现嵌套 repeater 的 WYSIWYG 场景,然后验证在不切换到 Preview 的情况下以 Edit 模式保存时内容仍会保留。
由索引模型根据 Issue 内容生成。
描述
Description
WYSIWYG fields inside ACF Blocks (particularly when nested in repeaters or groups) silently lose their content when saving the post. The content is only persisted if the user manually switches the block to "Preview" mode before saving.
Steps to Reproduce
- Create an ACF Block with a repeater field containing a WYSIWYG sub-field
- Add the block to a post in the Gutenberg editor
- Add a repeater row and type content into the WYSIWYG field
- Click "Save" (without switching the block to Preview first)
- Reload the page — the WYSIWYG content is gone
Expected Behavior
WYSIWYG field content should be saved regardless of whether the block is in Edit or Preview mode.
Actual Behavior
Content typed into WYSIWYG fields is lost on save unless the block is switched to Preview mode first. Other field types (text, select, etc.) save correctly.
Root Cause
In acf-pro-blocks.js, the BlockForm.componentDidAppend() method binds change detection to the block wrapper:
// ACF source (deobfuscated):
i.on("change keyup", () => {
clearTimeout(a);
a = setTimeout(s, 300); // s() calls acf.serialize() → setAttributes({ data })
});
- 主要语言
- PHP
- 星标
- 948
- 派生
- 198
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
AdvancedCustomFields/acf 的其他 Issue
-
PHP 8.5: "Using null as an array offset" deprecation in ACF_Data::is() when rendering a block with empty data (local-meta.php is_request)可能已有人在做 @faisalahammad 于 8 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
AdvancedCustomFields/acf#1044 ·
-
is_preview was called incorrectly notice on every early get_field() since 6.8.10 (acf_revisions::acf_validate_post_id)可能已有人在做 @faisalahammad 于 8 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
AdvancedCustomFields/acf#1041 · 1 条评论 ·
-
True / False ACF control bug on RTL layouts可能已有人在做 @elicohenator 于 31 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
AdvancedCustomFields/acf#1038 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
AdvancedCustomFields/acf#1034 · 3 条评论 ·
-
Bug: class-acf-field-icon_picker.php calls wp_get_attachment_image_url() with string Dashicon slug, causing fatal TypeError on PHP 8+可能已有人在做 @antwonw 于 42 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
AdvancedCustomFields/acf#1032 · 1 条评论 ·
查看 AdvancedCustomFields/acf 的全部 Issue
相似的 Issue
-
needs-triage Platform(Default)
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
sync-en
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
[Sync EN] Document Error thrown by shm_* functions on a detached segment (#5975)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭sync-en
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 3 天内回复
-
Перевод устарел
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 72/100