Add a safe guard that the variable is set before accessing it (https://github.com/woocommerce/woocommerce-blocks/pull/11424)
This commit is contained in:
parent
ebfa1acc51
commit
8c76a1a712
|
@ -61,7 +61,7 @@ class ProductTemplate extends AbstractBlock {
|
|||
$classnames = '';
|
||||
if ( isset( $block->context['displayLayout'] ) && isset( $block->context['query'] ) ) {
|
||||
if ( isset( $block->context['displayLayout']['type'] ) && 'flex' === $block->context['displayLayout']['type'] ) {
|
||||
if ( $block->context['displayLayout']['shrinkColumns'] ) {
|
||||
if ( isset( $block->context['displayLayout']['shrinkColumns'] ) && $block->context['displayLayout']['shrinkColumns'] ) {
|
||||
$classnames = "wc-block-product-template__responsive columns-{$block->context['displayLayout']['columns']}";
|
||||
} else {
|
||||
$classnames = "is-flex-container columns-{$block->context['displayLayout']['columns']}";
|
||||
|
|
Loading…
Reference in New Issue