Filter by Attribute: fix potential reading property of undefined error (#47699)
* Fix reading from undefined error in attribute-filter * Add changelog
This commit is contained in:
parent
04c8941099
commit
f55e25b009
|
@ -130,7 +130,7 @@ const AttributeFilterBlock = ( {
|
|||
resourceName: 'products/attributes/terms',
|
||||
resourceValues: [ attributeObject?.id || 0 ],
|
||||
shouldSelect: blockAttributes.attributeId > 0,
|
||||
query: { orderby: attributeObject.orderby },
|
||||
query: { orderby: attributeObject?.orderby || 'menu_order' },
|
||||
} );
|
||||
|
||||
const { results: filteredCounts, isLoading: filteredCountsLoading } =
|
||||
|
|
|
@ -13,7 +13,7 @@ export interface AttributeObject {
|
|||
id: number;
|
||||
label: string;
|
||||
name: string;
|
||||
order: 'menu_order' | 'name' | 'name_num' | 'id';
|
||||
orderby: 'menu_order' | 'name' | 'name_num' | 'id';
|
||||
parent: number;
|
||||
taxonomy: string;
|
||||
type: string;
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Filter by Attribute: fix potential reading from undefined error
|
Loading…
Reference in New Issue