From 913953f5862274d7b44bcf6089df934e6a505a85 Mon Sep 17 00:00:00 2001 From: Luigi Teschio Date: Fri, 8 Mar 2024 10:02:41 +0100 Subject: [PATCH] CYS: fix Undefined array key queryId warning (#45399) * CYS: fix Undefined array key queryId warning * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions --- .../client/customize-store/assembler-hub/block-editor.tsx | 2 ++ .../45399-45398-cys-warning-undefined-array-key-queryid | 4 ++++ 2 files changed, 6 insertions(+) create mode 100644 plugins/woocommerce/changelog/45399-45398-cys-warning-undefined-array-key-queryid diff --git a/plugins/woocommerce-admin/client/customize-store/assembler-hub/block-editor.tsx b/plugins/woocommerce-admin/client/customize-store/assembler-hub/block-editor.tsx index 29221cd64cb..52b1763c486 100644 --- a/plugins/woocommerce-admin/client/customize-store/assembler-hub/block-editor.tsx +++ b/plugins/woocommerce-admin/client/customize-store/assembler-hub/block-editor.tsx @@ -183,9 +183,11 @@ export const BlockEditor = ( {} ) => { onChange={ // We need to pass onChange for the logo screen so that logo block can be updated when we change the logo attributes in logo sidebar navigation screen component. // We also need to pass onChange for the assembler hub screen so when a block set an attribute during the block initialization, the block editor will be updated. + // We also need to pass onChange when the homepage pattern is updated because the Product Collection block sets a dynamic attribute and we need to update the block editor. // For other screens, we don't need to pass onChange. Otherwise, we'll get a race condition issue where the block editor will be updated twice: once from the onChange in the sidebar component, and once from the onChange in the block editor component. [ '/customize-store/assembler-hub/logo', + '/customize-store/assembler-hub/homepage', '/customize-store/assembler-hub', ].includes( urlParams.path ) ? onChange diff --git a/plugins/woocommerce/changelog/45399-45398-cys-warning-undefined-array-key-queryid b/plugins/woocommerce/changelog/45399-45398-cys-warning-undefined-array-key-queryid new file mode 100644 index 00000000000..5971da93b8e --- /dev/null +++ b/plugins/woocommerce/changelog/45399-45398-cys-warning-undefined-array-key-queryid @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +CYS: fix Undefined array key queryId warning \ No newline at end of file