Don't throw exception if data exists for `needsRefreshForInteractivityAPI` (#44808)

This commit is contained in:
Sam Seay 2024-02-21 13:53:20 +08:00 committed by GitHub
parent e0d8872376
commit cd5b4196d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Fix a possible fatal exception setting a duplicate asset registry key `needsRefreshForInteractivityAPI`

View File

@ -49,7 +49,7 @@ class ClassicTemplate extends AbstractDynamicBlock {
// Indicate to interactivity powered components that this block is on the page,
// and needs refresh to update data.
$this->asset_data_registry->add( 'needsRefreshForInteractivityAPI', true );
$this->asset_data_registry->add( 'needsRefreshForInteractivityAPI', true, true );
}
/**

View File

@ -180,6 +180,7 @@ class ProductQuery extends AbstractBlock {
// and needs refresh to update data.
$this->asset_data_registry->add(
'needsRefreshForInteractivityAPI',
true,
true
);
// Set this so that our product filters can detect if it's a PHP template.