From 92f257906684641d715fcaa0a508fbf402bbf6b8 Mon Sep 17 00:00:00 2001 From: Mikhaela Tapia <98727316+mxkae@users.noreply.github.com> Date: Thu, 14 Nov 2024 13:31:39 +0800 Subject: [PATCH] fix (icon block): deprecation error, return false for isEligible if no icon block (#3368) if icon label is modified and does not have icon block, isEligible returns an error --- src/block/icon-label/deprecated.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/block/icon-label/deprecated.js b/src/block/icon-label/deprecated.js index 504e597a5..ae4823925 100644 --- a/src/block/icon-label/deprecated.js +++ b/src/block/icon-label/deprecated.js @@ -12,6 +12,10 @@ const deprecated = [ attributes: attributes( '3.13.1' ), save: withVersion( '3.13.1' )( Save ), isEligible: ( attributes, innerBlocks ) => { + if ( innerBlocks[ 0 ]?.name !== 'stackable/icon' ) { + return false + } + const iconBlockAttributes = innerBlocks[ 0 ].attributes const hasIconSize = iconBlockAttributes.iconSize || iconBlockAttributes.iconSizeTablet || iconBlockAttributes.iconSizeMobile ? true : false const hasIconGap = attributes.iconGap || attributes.iconGapTablet || attributes.iconGapMobile ? true : false