Pattern override edits are lost when saving
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, react, wordpress
Hướng nghiên cứu
Start by tracing how GutenbergKit initializes the editor and registers block bindings; the issue identifies core/pattern-overrides and registerCoreBlockBindingsSources() as the relevant entry points. Compare this setup with WP Admin's source registration, including the labels and context listed in the issue. Done when overrides are saved into post content and existing overrides display correctly; the issue does not name a test file.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
Synced patterns can mark some of their content as editable per use ("pattern overrides"). In GutenbergKit, those fields look editable, but the changes never reach the post.
- Typing into an overridable field shows the new text, but the saved content doesn't include it. When the user reopens the post, the field shows the pattern's original text.
- Overrides saved elsewhere (e.g. in WP Admin) are kept in the post's content, but the editor displays the pattern's original text instead.
Expected: override edits are saved, and existing overrides are displayed, as in WP Admin.
Step-by-step reproduction instructions
- In WP Admin, create a synced pattern containing a paragraph, and enable overrides for that paragraph (Advanced → "Enable overrides").
- Insert the pattern into a post in GutenbergKit.
- Type into the paragraph.
- Save and reopen the post: the typed text is gone.
Screenshots, screen recording, code snippet
After typing " OVERRIDDEN" into the overridable paragraph, getTitleAndContent() returns <!-- wp:block {"ref":N} /-->, with no content attribute. With the sources registered (see below), it returns <!-- wp:block {"ref":N,"content":{"Body":{"content":"Override me OVERRIDDEN"}}} /-->.
Additional AI-generated details
- Cause: GutenbergKit never registers the editor's block-bindings sources, which include
core/pattern-overrides. WP Admin does it in two steps:- The server bootstraps each registered source's
name,labelandusesContextwith an inlinewp.blocks.registerBlockBindingsSource()call. edit-postthen callsregisterCoreBlockBindingsSources(), a private API of@wordpress/editor, to add the client handlers.
- The server bootstraps each registered source's
registerBlockBindingsSourcesilently refuses a source without a label. CallingregisterCoreBlockBindingsSources()on its own therefore registers nothing in GutenbergKit, where there's no server bootstrap.- What fixed it in a local test (web): register the four core sources first, with their labels and context, then call
registerCoreBlockBindingsSources(). Both typing and display then worked. The sources and their contexts:core/pattern-overrides:pattern/overridescore/post-metaandcore/post-data:postId,postTypecore/term-data:termId,taxonomy
core/post-metabindings are probably affected too (untested). Sources registered by plugins would need their labels from the server.
Environment info
GutenbergKit trunk (5f799a1f), @wordpress/editor 16.0.0. Reproduced in the web editor against a local WordPress site (latest release, Gutenberg plugin, Twenty Twenty-Five). The code path is shared with the iOS and Android editors.
Please confirm that you have searched existing issues in the repo.
- Yes
- Ngôn ngữ chính
- JavaScript
- Star
- 29
- Fork
- 6
- Merge trung bình
- 2 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 76
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của wordpress-mobile/GutenbergKit
-
[Type] Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
wordpress-mobile/GutenbergKit#940 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Type] Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
wordpress-mobile/GutenbergKit#884 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Type] Bug Android
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
wordpress-mobile/GutenbergKit#847 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Type] Bug iOS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
wordpress-mobile/GutenbergKit#846 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Type] Bug [Type] Code Quality iOS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
wordpress-mobile/GutenbergKit#668 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của wordpress-mobile/GutenbergKit
Issue tương tự
-
Remove: Tele Azul LogoĐang mởcheck:passed logos:remove
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
intuitem/ciso-assistant-community#5380 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
TarteelAI/quranic-universal-library#1111 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:ryoku type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
feedback simulation workshop
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
githubnext/gh-aw-workshop#6094 ·
Maintainer thường phản hồi trong vòng 1 ngày