From bda42f936c8ac1776218d0701f09e5ee1dd929fd Mon Sep 17 00:00:00 2001 From: Alexandre Lara Date: Fri, 1 Sep 2023 19:41:41 -0300 Subject: [PATCH] Product Gallery > Prevent error when "layout" is missing in block attributes (https://github.com/woocommerce/woocommerce-blocks/pull/10784) --- .../src/BlockTypes/ProductGalleryLargeImageNextPrevious.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce-blocks/src/BlockTypes/ProductGalleryLargeImageNextPrevious.php b/plugins/woocommerce-blocks/src/BlockTypes/ProductGalleryLargeImageNextPrevious.php index 3e2384b4057..cc366d697c0 100644 --- a/plugins/woocommerce-blocks/src/BlockTypes/ProductGalleryLargeImageNextPrevious.php +++ b/plugins/woocommerce-blocks/src/BlockTypes/ProductGalleryLargeImageNextPrevious.php @@ -110,7 +110,7 @@ class ProductGalleryLargeImageNextPrevious extends AbstractBlock { $this->get_class_suffix( $context ) ); - $alignment_class = $attributes['layout']['verticalAlignment'] ? 'is-vertically-aligned-' . $attributes['layout']['verticalAlignment'] : ''; + $alignment_class = isset( $attributes['layout']['verticalAlignment'] ) ? 'is-vertically-aligned-' . $attributes['layout']['verticalAlignment'] : ''; $position_class = 'wc-block-product-gallery-large-image-next-previous--' . $this->get_class_suffix( $context ); return strtr(