Title: Destructive bug
Last modified: October 6, 2023

---

# Destructive bug

 *  [Lovro Hrust](https://wordpress.org/support/users/lovor/)
 * (@lovor)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/destructive-bug/)
 * While working on custom FSE theme, on Front page template in block editor, I 
   used “Save Changes” option in sidebar. This completely cleared my template instead
   of saving into it, leaving only block reference to header template part. The 
   template is complex, having many blocks and one video block. I hope you can reproduce
   the bug.

Viewing 13 replies - 1 through 13 (of 13 total)

 *  Moderator [jordesign](https://wordpress.org/support/users/jordesign/)
 * (@jordesign)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/destructive-bug/#post-17111859)
 * Hey [@lovor](https://wordpress.org/support/users/lovor/) – that sounds terrible–
   I’m sorry to hear that happened, it definitely sounds odd. Have you had it happen
   multiple times? Or just the once?
 * I’ve been unable to recreate it at this stage. So if it has happened multiple
   times – that’s definitely something worth digging into further.
 *  Thread Starter [Lovro Hrust](https://wordpress.org/support/users/lovor/)
 * (@lovor)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/destructive-bug/#post-17111862)
 * Yes, it happens every time. I switched to manually copying blocks from content
   and pasting into templates.
 *  Moderator [jordesign](https://wordpress.org/support/users/jordesign/)
 * (@jordesign)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/destructive-bug/#post-17111869)
 * Thanks for confirming [@lovor](https://wordpress.org/support/users/lovor/) – 
   can I also ask, does this behaviour only happen when the Create Block Theme plugin
   is active?
   Are you able to try it with all other plugins _except_ the Create 
   Block Theme plugin deactivated as well – to see if that makes a difference?
 *  Thread Starter [Lovro Hrust](https://wordpress.org/support/users/lovor/)
 * (@lovor)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/destructive-bug/#post-17111881)
 * This can’t happen when create block theme is not active, since this happens upon
   pushing “save changes” button
 * I do not have much plugins activated, reBusted! and safeSVG. Yet, I tried deactivated
   all except create block theme and it happens nevertheless.
   If you provide some
   kind of contact, I can share template with you.
 *  Thread Starter [Lovro Hrust](https://wordpress.org/support/users/lovor/)
 * (@lovor)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/destructive-bug/#post-17111886)
 * Also, I am using WordPress version 6.3.1. Did you test with this version?
 *  Thread Starter [Lovro Hrust](https://wordpress.org/support/users/lovor/)
 * (@lovor)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/destructive-bug/#post-17111890)
 * What I noticed is, that after attempting saving changes in my front-page.html
   template this is written:
   <!– wp:pattern {“slug”:”themename/front-page”} /–>Should
   it not save content to template? It looks it attempts to create pattern and then
   refer in template to it, but result is that page is broken.
 *  Thread Starter [Lovro Hrust](https://wordpress.org/support/users/lovor/)
 * (@lovor)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/destructive-bug/#post-17111910)
 * Perhaps I misunderstood what plugin does, I expected it to save block contents
   from database to template and reset template in database. Instead, it creates
   pattern in patterns directory and sets template to point to it. Odd.
 *  Thread Starter [Lovro Hrust](https://wordpress.org/support/users/lovor/)
 * (@lovor)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/destructive-bug/#post-17112422)
 * One idea occured to me – I am using WP 6.3.1. Could this be related to change
   that occured in admin, where template parts are moved in patterns section? I 
   am still not sure if this is a feature or a bug (for me it is a bug, did you 
   intend to create a pattern?). I also found why it breaks images. I uploaded media
   files from certain folder in theme directory into media library. Somehow, that
   original location is still remembered and when plugin creates pattern, it refers
   to original location, instead of media library location, but media files are 
   not there anymore, i.e., this is produced code:
 * <video loop muted poster=”<?php echo esc_url( get_stylesheet_directory_uri() );?
   >/assets/images/hero-video-thumbnail.jpg” src=”<?php echo esc_url( get_stylesheet_directory_uri());?
   >/assets/videos/Above-The-Fold-draft.webm” playsinline></video>
 *  Moderator [jordesign](https://wordpress.org/support/users/jordesign/)
 * (@jordesign)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/destructive-bug/#post-17114854)
 * Hey [@lovor](https://wordpress.org/support/users/lovor/) – The purpose of the
   Create Block Theme plugin is predominantly to create a _standalone_ theme (which
   can be shared and distributed) that is exported – rather than specifically a 
   part of the ongoing editing of the theme (which is what Gutenberg/Site Editor
   is handling generally).
 * It _sounds_ like the error you’re getting is when you’re saving templates in 
   the Site Editor itself – which would be related to Gutenberg, rather than the
   Create Block Theme plugin.
 * Would it be possible to please take a screencast/video of the steps you follow
   and the result – to help narrow down where/why that is happening?
 *  Thread Starter [Lovro Hrust](https://wordpress.org/support/users/lovor/)
 * (@lovor)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/destructive-bug/#post-17115148)
 * Yes, I am aware that the primary purpose is to create block theme, I even started
   the current theme I am developing with this plugin. I wrote for brevity that “
   purpose is” instead of “one of the purposes” 🙂 Though, create block theme also
   registers a plugin in site editor, adding small wrench icon in the top bar, and
   clicking that fills a sidebar with several actions, one of which is “Save changes”,
   which I am referring to. I could take a video, but due to NDA, I will not expose
   publicly video of this theme, perhaps in a PM, or I will try to replicate the
   bug in new theme. I think this could easily be replicated, it seems that in WP
   6.3.1 this functions in this way, instead saving changes to template creates 
   new pattern putting all content in it and changing template just to reference
   to pattern. Further, in template paths are changed to original inserting location
   instead of location in media library.
    -  This reply was modified 2 years, 7 months ago by [Lovro Hrust](https://wordpress.org/support/users/lovor/).
 *  [Tony G](https://wordpress.org/support/users/starbuck/)
 * (@starbuck)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/destructive-bug/#post-17192412)
 * [@lovor](https://wordpress.org/support/users/lovor/) concisely described what
   I verbosely (and unsuccessfully?) tried to detail in this [other thread](https://wordpress.org/support/topic/dont-save-style-variation-after-changing-global-styles/).
 *  [amyg1224](https://wordpress.org/support/users/amyg1224/)
 * (@amyg1224)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/destructive-bug/#post-17251300)
 * What you experienced is exactly the same thing that occured for me.
 *  Moderator [jordesign](https://wordpress.org/support/users/jordesign/)
 * (@jordesign)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/destructive-bug/#post-17253247)
 * [@starbuck](https://wordpress.org/support/users/starbuck/) [@amyg1224](https://wordpress.org/support/users/amyg1224/)
   ordinarily we discourage ‘me too’ comments – but as this is yet to be resolved–
   any additional information you can provide may help with tracking down the bug.
 * Are either of you able to share a screenshot of this happening?

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Destructive bug’ is closed to new replies.

 * ![](https://ps.w.org/create-block-theme/assets/icon-256x256.png?rev=2777957)
 * [Create Block Theme](https://wordpress.org/plugins/create-block-theme/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/create-block-theme/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/create-block-theme/)
 * [Active Topics](https://wordpress.org/support/plugin/create-block-theme/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/create-block-theme/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/create-block-theme/reviews/)

## Tags

 * [deleting](https://wordpress.org/support/topic-tag/deleting/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * 13 replies
 * 4 participants
 * Last reply from: [jordesign](https://wordpress.org/support/users/jordesign/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/destructive-bug/#post-17253247)
 * Status: not resolved