-
Notifications
You must be signed in to change notification settings - Fork 219
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 |
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!
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 <github-actions@github.com> Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com> Co-authored-by: Alba Rincón <albarin@users.noreply.github.com> Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
* 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 <github-actions@github.com> Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com> Co-authored-by: Alba Rincón <albarin@users.noreply.github.com> Co-authored-by: Alba Rincón <alba.rincon@automattic.com> Co-authored-by: Luigi <gigitux@gmail.com>
Fixed an error caused by trying to access the
slug
attribute on a null object.Also changed
slug
bytaxonomy
, otherwise, thetaxonomy_is_product_attribute
would 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 438
errorThe archive product template loads
WooCommerce Visibility