-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CYS - fix crash Product Collection block #47511
CYS - fix crash Product Collection block #47511
Conversation
Hi @albarin, @nefeline, @imanish003, @kmanijak, @woocommerce/woo-fse Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
@@ -40,6 +40,10 @@ export const useTracksLocation = ( templateSlug: string ) => { | |||
return postType; | |||
} | |||
|
|||
if ( ! templateSlug ) { | |||
return Locations.OTHER; |
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'm not sure that this is correct, before merging the PR let's wait for @kmanijak and @imanish003 feedback.
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.
Hey @gigitux , it's a correct fix but it's a duplicate to this one by @imanish003 : #47504.
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 see the other PR has some conflicts. I'll resolve them and merge the other PR to unlock you.
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, @kmanijak! 🚀
I'm going to close this PR!
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. Test this pull request with WordPress Playground. Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit. |
Submission Review Guidelines:
Changes proposed in this Pull Request:
As described in #47469, the Product Collection block crashes on the homepage pattern previews. This happens because the
templateSlug
is undefined and this case hasn't been handled. This PR ensure thattemplateSlug
is defined.Closes #47469.
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Changelog entry
Significance
Type
Message
CYS - fix crash Product Collection block
Comment