Block Editor: Ensure synced patterns are accounted for in 'getAllowedBlocks'#52546
Merged
Block Editor: Ensure synced patterns are accounted for in 'getAllowedBlocks'#52546
Conversation
|
Size Change: +11 B (0%) Total Size: 1.43 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in e0831a6. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5527988086
|
ntsekouras
reviewed
Jul 12, 2023
westonruter
added a commit
that referenced
this pull request
Jul 12, 2023
…dd/defer-script-loading-strategy * 'trunk' of https://github.com/WordPress/gutenberg: Update Changelog for 16.2.0 Adding support for defined IDs in `TextControl` component (#52028) Bump plugin version to 16.2.0 Revert "Bump plugin version to 16.2.0" Bump plugin version to 16.2.0 Add maxLength to LinkControl search items (#52523) [RNMobile] Update Editor block inserter button styles and default text input placeholder/selection styles (#52269) Site Editor: Reset device preview type when exiting the editing mode (#52566) Trim footnote anchors from excerpts (#52518) Add back old Navigation and File blocks JavaScript implementation when Gutenberg is not installed (#52553) Block Editor: Ensure synced patterns are accounted for in 'getAllowedBlocks' (#52546) Fix md5 class messed up with new block key (#52557) Fix entity cache misses for single posts due to string as recordKey (#52338) Make "My patterns" permanently visible (#52531) Hide site hub when resizing frame upwards to avoid overlap (#52180) Fix "Manage all patterns" link appearance (#52532) Update navigation menu title size & weight in detail panels (#52477) Site Editor Patterns: Ensure sidebar does not shrink when long pattern titles are used (#52547) Site Editor: Restore quick inserter 'Browse all' button (#52529) Patterns: update the title of Pattern block in the block inspector card (#52010)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Fixes #52401.
PR updates the
getAllowedBlocksselector and ensures the Synced Patterns (reusable blocks) are accounted for when checking allowed block types.This fixes a bug with the inserter when a block has only two allowed blocks specified, and one of them is synced pattern.
Why?
getAllowedBlockshasn't accounted for this and incorrectly enabled "smart appender".How?
I added a separate check if the reusable block can be inserted and append the block name to the allowed block list. This matches the logic in
hasInserterItemsandgetInserterItems.Testing Instructions
allowedBlocksdefined.Example block
Screenshots or screencast
CleanShot.2023-07-12.at.09.27.59.mp4