Skip to content

Commit

Permalink
Section Styles: Fix error when blocks are deregistered (#63252)
Browse files Browse the repository at this point in the history
Co-authored-by: aaronrobertshaw <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: ndiego <[email protected]>
Co-authored-by: MadtownLems <[email protected]>
  • Loading branch information
5 people authored Jul 8, 2024
1 parent 99352db commit 155fb31
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ export const getNodesWithStyles = ( tree, blockSelectors ) => {
}
const variationSelector =
blockSelectors[ blockName ]
.styleVariationSelectors?.[ variationName ];
?.styleVariationSelectors?.[ variationName ];

// Process the variation's inner element styles.
// This comes before the inner block styles so the
Expand Down Expand Up @@ -700,18 +700,18 @@ export const getNodesWithStyles = ( tree, blockSelectors ) => {
const variationBlockSelector = scopeSelector(
variationSelector,
blockSelectors[ variationBlockName ]
.selector
?.selector
);
const variationDuotoneSelector = scopeSelector(
variationSelector,
blockSelectors[ variationBlockName ]
.duotoneSelector
?.duotoneSelector
);
const variationFeatureSelectors =
scopeFeatureSelectors(
variationSelector,
blockSelectors[ variationBlockName ]
.featureSelectors
?.featureSelectors
);

const variationBlockStyleNodes =
Expand All @@ -728,10 +728,10 @@ export const getNodesWithStyles = ( tree, blockSelectors ) => {
featureSelectors: variationFeatureSelectors,
fallbackGapValue:
blockSelectors[ variationBlockName ]
.fallbackGapValue,
?.fallbackGapValue,
hasLayoutSupport:
blockSelectors[ variationBlockName ]
.hasLayoutSupport,
?.hasLayoutSupport,
styles: variationBlockStyleNodes,
} );

Expand Down

1 comment on commit 155fb31

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 155fb31.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9842565050
📝 Reported issues:

Please sign in to comment.