Site editor duplicates templates/template-parts on editing them #43
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
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
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
Anyone else seeing this?
Here is the upstream Gutenberg bug @aadil posted https://github.com/WordPress/gutenberg/issues/50816 which they closed due to not being able to replicate.
I found the issues
Look at the permissions on our theme @aadil
Ok I tested it and it fixed it with a chown:
Doesnt' seem to be any issue with our theme repo: https://git.autonomic.zone/autonomic-cooperative/autonomic-block-theme
Could possibly just be something we did. Maybe even keyboard to chair? Unless anyone can recreate, suggest we close @aadil
hmm I think we have to do another patch to https://git.coopcloud.tech/coop-cloud/wordpress/src/branch/main/entrypoint.sh.tmpl
And we
chown -R www-data:www-data /var/www/html/wp-content/uploads/tochown -R www-data:www-data /var/www/html/wp-content/to cover all the files that need to be patched.PR: #60