-
Notifications
You must be signed in to change notification settings - Fork 215
Fix error when trying to access the queried object when it's null #7664
Conversation
|
The release ZIP for this PR is accessible via: |
TypeScript Errors ReportFiles with errors: 440 🎉 🎉 This PR does not introduce new TS errors. |
|
Size Change: 0 B Total Size: 990 kB ℹ️ View Unchanged
|
Script Dependencies ReportThere is no changed script dependency between this branch and trunk. This comment was automatically generated by the |
Aljullu
left a comment
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 was struggling to reproduce the reported issue, but I finally could. It turns out it's only reproducible in block themes.
Anyway, confirming this PR fixes it. 👌 Thanks, Alba!
Aljullu
left a comment
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.
Retested everything with the testing steps from #7640 and everything is working fine and the correct template is loading. 🚢
Thanks 🙏 |
…ocommerce#7664) * Fix error when trying to access the queried object when it's null. * Check if the `slug` exists * Use the taxonomy name instead of the slug, otherwise it returns false
* Empty commit for release pull request * Display correct block template when filtering by attribute (#7640) * Fix error when trying to access the queried object when it's null (#7664) * Fix error when trying to access the queried object when it's null. * Check if the `slug` exists * Use the taxonomy name instead of the slug, otherwise it returns false * Update readme changelog * Add testing notes * Improve testing notes format * Bumping version strings to new version. Co-authored-by: github-actions <[email protected]> Co-authored-by: Albert Juhé Lluveras <[email protected]> Co-authored-by: Alba Rincón <[email protected]> Co-authored-by: Alba Rincón <[email protected]>
* Empty commit for release pull request * Display correct block template when filtering by attribute (#7640) * Fix error when trying to access the queried object when it's null (#7664) * Fix error when trying to access the queried object when it's null. * Check if the `slug` exists * Use the taxonomy name instead of the slug, otherwise it returns false * Update readme changelog * Add testing notes * Improve testing notes format * Bumping version strings to new version. * Prevent Mini Cart loading the same script twice (#7794) * Empty commit for release pull request * update changelog * add testing instructions * update zip file link * Mini Cart: load wc-blocks-registry package at the load of the page instead of lazy load it (#7813) * update changelog * update testing instructions * update zip file link * Bumping version strings to new version. Co-authored-by: github-actions <[email protected]> Co-authored-by: Albert Juhé Lluveras <[email protected]> Co-authored-by: Alba Rincón <[email protected]> Co-authored-by: Alba Rincón <[email protected]> Co-authored-by: Luigi <[email protected]>
Fixed an error caused by trying to access the
slugattribute on a null object.Also changed
slugbytaxonomy, otherwise, thetaxonomy_is_product_attributewould always return false.Testing
The error is no longer there
trunk, go to the homepage of your site and see theWarning: Attempt to read property "slug" on null in /plugins/woocommerce-blocks/src/BlockTemplatesController.php on line 438errorThe archive product template loads
WooCommerce Visibility