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

Mini Cart block is not available from the Edit template screen #6342

Closed
Aljullu opened this issue Apr 28, 2022 · 7 comments · Fixed by #6351
Closed

Mini Cart block is not available from the Edit template screen #6342

Aljullu opened this issue Apr 28, 2022 · 7 comments · Fixed by #6351
Assignees
Labels
block: mini-cart Issues related to the Mini-Cart block. type: bug The issue/PR concerns a confirmed bug.

Comments

@Aljullu
Copy link
Contributor

Aljullu commented Apr 28, 2022

When editing a template from the Edit template feature in the post/page editor, the Mini Cart block is not available.

To reproduce

  1. From wp-admin, go to Pages and edit one of your pages.
  2. In the Page sidebar, edit the template:

  1. Notice the Mini Cart block is not available in the inserter (and if it was already in your header, an error is shown):

imatge

Expected behavior

It should be possible to insert the Mini Cart block from the template editor.

@Aljullu Aljullu added type: bug The issue/PR concerns a confirmed bug. block: mini-cart Issues related to the Mini-Cart block. labels Apr 28, 2022
@Aljullu
Copy link
Contributor Author

Aljullu commented Apr 28, 2022

I wonder if we should revert the changes introduced in #5653. Thoughts @dinhtungdu @gigitux?

We might also take the chance to experimental with the new API introduced in WP 6.0 to filter allowed blocks based on the context: WordPress/gutenberg#28517 (comment).

@gigitux
Copy link
Contributor

gigitux commented Apr 29, 2022

Nice shortcut for editing template!

I wonder if we should revert the changes introduced in #5653. Thoughts @dinhtungdu @gigitux?
We might also take the chance to experimental with the new API introduced in WP 6.0 to filter allowed blocks based on the context: WordPress/gutenberg#28517 (comment).

I agree with you! 👍

@dinhtungdu
Copy link
Member

I wonder if we should revert the changes introduced in #5653.

Look like it's the way to go. $pagenow is not efficient when the Template Editor is loaded inside Block Editor.

@dinhtungdu
Copy link
Member

We might also take the chance to experimental with the new API introduced in WP 6.0 to filter allowed blocks based on the context: WordPress/gutenberg#28517 (comment).

@Aljullu I tested using allowed_block_types_all, the filter is called when the post/page edit screen loads initially. But when editing the template from the Setting sidebar, the filter isn't called. I tested with both Core versions 5.9.3 and 6.0 beta.

@Aljullu
Copy link
Contributor Author

Aljullu commented May 2, 2022

Oh, too bad. Thanks for testing, @dinhtungdu! I wonder if we should comment in that issue or open a new one so GB devs are aware of this limitation?

@dinhtungdu
Copy link
Member

I wonder if we should comment in that issue or open a new one so GB devs are aware of this limitation?

Sure thing! I will open an issue there for better visibility.

@dinhtungdu
Copy link
Member

Sure thing! I will open an issue there for better visibility.

Opened WordPress/gutenberg#40780.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: mini-cart Issues related to the Mini-Cart block. type: bug The issue/PR concerns a confirmed bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants