-
Notifications
You must be signed in to change notification settings - Fork 219
Check if index element exists before using for Product Collection #10300
Conversation
The release ZIP for this PR is accessible via:
Script Dependencies ReportThere is no changed script dependency between this branch and trunk. This comment was automatically generated by the TypeScript Errors Report
🎉 🎉 This PR does not introduce new TS errors. |
Size Change: 0 B Total Size: 1.36 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am happy I have stumbled across this PR. I will now update my Product Gallery Thumbnails PR that has the same exact issue with not checking if the context exists first.
I have tested this, and it indeed gets rid of the Undefined array key
warnings.
The only thing I'd recommend is updating the title of the PR and perhaps mentioning that this relates to the context. And perhaps adding a short description in the body/comment on top.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @roykho for taking care of that issue!
Product Collection is still experimental, hence could you please:
- Change the "WooCommerce Visibility" to "Experimental"
- Mark "Do not include in the Testing Notes"?
While this solution is valid I'm still wondering why Product Collection/Product Template tries to render inner blocks like Product Button or Image, while there's no results to display 🤔
Fixes #10232
Testing
User Facing Testing
Products (beta)
block and replace withProduct Collection
block. Make sure to have "Inherit query from template" option enabled. Save.WooCommerce Visibility
Performance Impact
Changelog