CYS: fix php warning raise by the Product Collection block (#43546)

* CYS: fix php warning raise by the Product Collection block

* fix typo

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Luigi Teschio 2024-01-12 13:44:06 +01:00 committed by GitHub
parent aa661f2234
commit 5edea79b41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -155,9 +155,13 @@ export const BlockEditor = ( {} ) => {
<BlockPreview
blocks={ renderedBlocks }
onChange={
// We only 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 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.
// 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.
urlParams.path === '/customize-store/assembler-hub/logo'
[
'/customize-store/assembler-hub/logo',
'/customize-store/assembler-hub',
].includes( urlParams.path )
? onChange
: undefined
}

View file

@ -0,0 +1,4 @@
Significance: minor
Type: fix
CYS: fix php warning raise by the Product Collection block.