Site editor duplicates templates/template-parts on editing them #43

Open
opened 2024-05-11 16:09:30 +00:00 by aadil · 0 comments
Owner

Copied from https://github.com/WordPress/gutenberg/issues/50816. I'm posting this here because I've only experienced this bug on wordpress sites running on co-op cloud (specifically, aadils.computer and autonomic.zone). When I imported the same site into Local, the issue disappeared. It seems to happen independent of what version of WordPress/Gutenberg I'm running.

Description

I've been experiencing this bug for a long time (I think since 6.0?) where editing any template or template part in the site editor causes WordPress to create a new template/template-part of the same name instead of updating the existing one.

image

This new template (or template-part), containing all modifications, is created under the current WordPress user, and the default one which is actually being used by theme is cleared of all customizations and is what shows up on the front-end.

(See screen recording for context)

Step-by-step reproduction instructions

  1. Go to site editor
  2. Open a template or template part
  3. Make any modification (e.g. add a new block or customize an existing block in the template)
  4. Save your changes
  5. Refresh the front-end - the template or template-part you were editing should be restored to its default state instead of being updated with your edits.

Screenshots, screen recording, code snippet

Video of me breaking the site with a simple edit to the home template:

gutenberg-template-editing-bug.webm

Video of me restoring the home template:

Kooha-2023-05-20-19-04-56.webm

Copied from https://github.com/WordPress/gutenberg/issues/50816. I'm posting this here because I've only experienced this bug on wordpress sites running on co-op cloud (specifically, aadils.computer and autonomic.zone). When I imported the same site into [Local](https://localwp.com), the issue disappeared. It seems to happen independent of what version of WordPress/Gutenberg I'm running. ### Description I've been experiencing this bug for a long time (I think since 6.0?) where editing any template or template part in the site editor causes WordPress to create a new template/template-part of the same name instead of updating the existing one. ![image](https://github.com/WordPress/gutenberg/assets/31581044/cc1829e7-cf11-4fea-80b0-7295bfdf3c28) This new template (or template-part), containing all modifications, is created under the current WordPress user, and the default one which is actually being used by theme is cleared of all customizations and is what shows up on the front-end. (See screen recording for context) ### Step-by-step reproduction instructions 1. Go to site editor 2. Open a template or template part 3. Make any modification (e.g. add a new block or customize an existing block in the template) 4. Save your changes 5. Refresh the front-end - the template or template-part you were editing should be restored to its default state instead of being updated with your edits. ### Screenshots, screen recording, code snippet Video of me breaking the site with a simple edit to the home template: [gutenberg-template-editing-bug.webm](https://github.com/WordPress/gutenberg/assets/31581044/5347c51b-b6a0-4db3-b84a-8a50c8d7e554) Video of me restoring the home template: [Kooha-2023-05-20-19-04-56.webm](https://github.com/WordPress/gutenberg/assets/31581044/0ac983aa-4e78-4da8-a6d2-7a8cb0a4f2cc)
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/wordpress#43
No description provided.