Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Block error is displayed on clearing customizations for Woo Templates #9637

Closed
nefeline opened this issue May 29, 2023 · 2 comments · Fixed by #9759
Closed

Block error is displayed on clearing customizations for Woo Templates #9637

nefeline opened this issue May 29, 2023 · 2 comments · Fixed by #9759
Assignees
Labels
type: bug The issue/PR concerns a confirmed bug.

Comments

@nefeline
Copy link
Contributor

Describe the bug

When clearing out the customizations for a WooCommerce template, an error is consistently displayed when accessing it on the editor side:

Your site doesn’t include support for the "woocommerce/legacy-template" block. You can leave this block intact or remove it entirely.

This error occurs with and without having the Gutenberg plugin enabled (WordPress version 6.2, WooCommerce 7.8.0 and WooCommerce Blocks 10.4.0).

Screen.Recording.2023-05-25.at.22.14.01.mov

To reproduce

Steps to reproduce the behavior:

  1. Make sure you have a block theme enabled, such as Twenty-twenty three
  2. Click on Edit Site
  3. Click on Templates and customize any of the Woo's templates: e.g. the Single Product and save the changes
  4. Now go back to the Site Editor and under Templates > Manage all templates, click on the ellipsis button and clear all customizations for the Single Product template: wait for the success message to be displayed.
  5. Now, without refreshing the page, go back to edit the Single Product template: notice how the Your site doesn’t include support for the "woocommerce/legacy-template" block. You can leave this block intact or remove it entirely. is displayed.
  6. Now refresh the editor page and verify that the block is rendered without any problems.

Expected behavior

No block errors should be displayed when accessing any of the Woo templates right after clearing customizations.

Environment

WordPress (please complete the following information):

  • WordPress version: [6.2.2]
  • WooCommerce version: [7.8.0]
  • WooCommerce Blocks version: [10.4.0]
@nefeline nefeline added the type: bug The issue/PR concerns a confirmed bug. label May 29, 2023
@nefeline
Copy link
Contributor Author

nefeline commented May 29, 2023

Porting over @gigitux 's comment over here as it might be useful for solving this problem:

It could be depended by this code.
We register/de-register the block based on the template. There could be something wrong with that logic.

@gigitux gigitux self-assigned this Jun 5, 2023
@nerrad
Copy link
Contributor

nerrad commented Jun 5, 2023

I'm also guessing this is because the site editor is client-side only when navigating between routes so the block isn't registered on initial load maybe?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.