Fix undefined variable in ProductSchema.php closure #2962
Conversation
Size Change: 0 B Total Size: 1.65 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.
Thanks for taking care of this Nadir. Code wise this is good, but I think our testing notes could include a bit more about what is impacted by this change (in particular anything that interacts with the routes using product schema). Can you expand on that in the testing notes please and include what should be tested to ensure there are no unexpected side-effects of this change?
I'll pre-approve but on the assumption additional testing notes will be added (and you've verified what you note works)
assets/js/blocks/products/utils.js
Outdated
@@ -35,7 +35,7 @@ export const renderNoProductsPlaceholder = ( blockTitle, blockIcon ) => ( | |||
className="wc-block-products__add-product-button" | |||
isDefault | |||
isLarge | |||
href={ adminUrl + 'post-new.php?post_type=product' } | |||
href={ ADMIN_URL + 'post-new.php?post_type=product' } |
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.
wowzer! good catch here!
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.
this was from another PR, not sure how it got here 😅, props to Albert.
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.
this was from another PR, not sure how it got here 😅, props to Albert.
a0af100
to
d6504c1
Compare
Tested okay, I also verified that there was no impact to variation meta data returned as a result of this change. |
Fixes the issue by defining
use ( $product )
in the closure, as far as my googling went, this syntax is supported from PHP 5.3, so we're safe (WC requires 7.0).Fixes #2896
How to test the changes in this Pull Request:
How to test
0- Make sure you have WP_DEBUG set to true.
1- Load a page that already contains a product data, so single product or All Products, either in the editor or frontend.
2- Make sure no notices are printed to the page, you can check the source code or at the top of the page.
Changelog