Pattern override edits are lost when saving
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, react, wordpress
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- JavaScript
- Stelle
- 29
- Fork
- 6
- Merge medio
- 2g 1h
- PR unite (30g)
- 76
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di wordpress-mobile/GutenbergKit
-
[Type] Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
wordpress-mobile/GutenbergKit#940 ·
I maintainer di solito rispondono entro 1 giorno
-
[Type] Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
wordpress-mobile/GutenbergKit#884 ·
I maintainer di solito rispondono entro 1 giorno
-
[Type] Bug Android
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
wordpress-mobile/GutenbergKit#847 ·
I maintainer di solito rispondono entro 1 giorno
-
[Type] Bug iOS
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
wordpress-mobile/GutenbergKit#846 ·
I maintainer di solito rispondono entro 1 giorno
-
[Type] Bug [Type] Code Quality iOS
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
wordpress-mobile/GutenbergKit#668 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di wordpress-mobile/GutenbergKit
Issue simili
-
Remove: Tele Azul LogoApertacheck:passed logos:remove
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
intuitem/ciso-assistant-community#5380 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
TarteelAI/quranic-universal-library#1111 ·
I maintainer di solito rispondono entro 1 giorno
-
area:ryoku type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
feedback simulation workshop
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
githubnext/gh-aw-workshop#6094 ·
I maintainer di solito rispondono entro 1 giorno