Pattern override edits are lost when saving
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- javascript, react, wordpress
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- JavaScript
- Étoiles
- 29
- Forks
- 6
- Merge moyen
- 2 j 1 h
- PR mergées (30 j)
- 76
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de wordpress-mobile/GutenbergKit
-
[Type] Bug
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
wordpress-mobile/GutenbergKit#940 ·
Les mainteneurs répondent en général sous 1 jour
-
[Type] Bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
wordpress-mobile/GutenbergKit#884 ·
Les mainteneurs répondent en général sous 1 jour
-
[Type] Bug Android
Difficulté 2/5 1-3 heures Accessibilité débutants 79/100
wordpress-mobile/GutenbergKit#847 ·
Les mainteneurs répondent en général sous 1 jour
-
[Type] Bug iOS
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
wordpress-mobile/GutenbergKit#846 ·
Les mainteneurs répondent en général sous 1 jour
-
[Type] Bug [Type] Code Quality iOS
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
wordpress-mobile/GutenbergKit#668 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de wordpress-mobile/GutenbergKit
Issues similaires
-
bug help wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 80/100
LangerSword/gitone#7 ·
-
bootstrap enhancement themes
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
quarto-dev/quarto-cli#15421 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
good first issue reliability security should-have
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 13 jours
-
[BUG]: chunkSource protocol stripping truncates URLs or reads an inner schemePeut-être pris @Bensonbenyi l’a pris aujourd’hui. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
Mintplex-Labs/anything-llm#7338 ·
Les mainteneurs répondent en général sous 1 jour