Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix failing test by adding some back compat
  • Loading branch information
talldan committed Sep 10, 2025
commit 8b2215ac5401871a7971c1d28f34d7d69848a4d7
14 changes: 8 additions & 6 deletions packages/block-editor/src/store/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2273,12 +2273,14 @@ function getDerivedBlockEditingModesForTree(
( clientId ) =>
state.blockListSettings[ clientId ]?.templateLock === 'contentOnly'
);
const unsyncedPatternClientIds = state.blocks.attributes
.keys()
.filter(
( clientId ) =>
state.blocks.attributes.get( clientId )?.metadata?.patternName
);
// Use array.from for better back compat. Older versions of the iterator returned
// from `keys()` didn't have the `filter` method.
const unsyncedPatternClientIds = Array.from(
state.blocks.attributes.keys()
).filter(
( clientId ) =>
state.blocks.attributes.get( clientId )?.metadata?.patternName
);
const contentOnlyParents = [
...contentOnlyTemplateLockedClientIds,
...unsyncedPatternClientIds,
Expand Down