-
Notifications
You must be signed in to change notification settings - Fork 219
Fix Single Product Classic Template block not showing on the front-end #11455
Fix Single Product Classic Template block not showing on the front-end #11455
Conversation
In WordPress 6.4, it appears that the global `have_posts` is `false` in the context of the full site editing single product template. This breaks the Classic Template block. In this commit, we are creating a custom query using the available id instead of relying on the global query. This might be a temporary workaround as we are waiting to see if that's an issue that core is willing to fix, as it might affect backwards-compatibility for other vendors.
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.54 MB ℹ️ View Unchanged
|
Can confirm this is solved in 6.4-rc.3 as expected. |
Reopening this because of this incident: p1699405119976099-slack-C03Q87XT1QF cc @dinhtungdu |
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.
Tested and can confirm this fix the single product issue with legacy template. The
Failed Playwright E2E tests - Normal are not related as the same tests are failing on trunk: https://github.com/woocommerce/woocommerce-blocks/actions/runs/6790191926/job/18459058400
#11455) In WordPress 6.4, it appears that the global `have_posts` is `false` in the context of the full site editing single product template. This breaks the Classic Template block. In this commit, we are creating a custom query using the available id instead of relying on the global query. This might be a temporary workaround as we are waiting to see if that's an issue that core is willing to fix, as it might affect backwards-compatibility for other vendors. (cherry picked from commit d9e8809)
#11455) In WordPress 6.4, it appears that the global `have_posts` is `false` in the context of the full site editing single product template. This breaks the Classic Template block. In this commit, we are creating a custom query using the available id instead of relying on the global query. This might be a temporary workaround as we are waiting to see if that's an issue that core is willing to fix, as it might affect backwards-compatibility for other vendors. (cherry picked from commit d9e8809)
* Empty commit for release pull request * Enhancement/New blockified Order Confirmation on new installs with block-based themes (#11615) * Use new blockified Order Confirmation on blocks themes * Handle translations on the new blockified Order Confirmation * Update readme.txt * npm run change-versions * Filter By Rating: fix overlapping stars (#11644) * Fix Playwright E2E tests - SideEffects (#11638) * Removed span text and test * Testing notes * Empty commit for release pull request * Fix Single Product Classic Template block not showing on the front-end (#11455) In WordPress 6.4, it appears that the global `have_posts` is `false` in the context of the full site editing single product template. This breaks the Classic Template block. In this commit, we are creating a custom query using the available id instead of relying on the global query. This might be a temporary workaround as we are waiting to see if that's an issue that core is willing to fix, as it might affect backwards-compatibility for other vendors. (cherry picked from commit d9e8809) * Empty commit for release pull request * Update readme.txt * Bump versions to 11.4.5 * Add Testing Notes --------- Co-authored-by: github-actions <[email protected]> Co-authored-by: Paulo Arromba <[email protected]> Co-authored-by: Luigi Teschio <[email protected]> Co-authored-by: Lucio Giannotta <[email protected]>
#11455) In WordPress 6.4, it appears that the global `have_posts` is `false` in the context of the full site editing single product template. This breaks the Classic Template block. In this commit, we are creating a custom query using the available id instead of relying on the global query. This might be a temporary workaround as we are waiting to see if that's an issue that core is willing to fix, as it might affect backwards-compatibility for other vendors.
* Fix Single Product Classic Template block not showing on the front-end (#11455) In WordPress 6.4, it appears that the global `have_posts` is `false` in the context of the full site editing single product template. This breaks the Classic Template block. In this commit, we are creating a custom query using the available id instead of relying on the global query. This might be a temporary workaround as we are waiting to see if that's an issue that core is willing to fix, as it might affect backwards-compatibility for other vendors. * Empty commit for release pull request * update testing instructions * bump version * add zip link --------- Co-authored-by: Lucio Giannotta <[email protected]> Co-authored-by: github-actions <[email protected]> Co-authored-by: Luigi <[email protected]>
* Empty commit for release pull request * Add readme and testing notes * Bump versions to 11.5.1 * Fix Single Product Classic Template block not showing on the front-end (#11455) In WordPress 6.4, it appears that the global `have_posts` is `false` in the context of the full site editing single product template. This breaks the Classic Template block. In this commit, we are creating a custom query using the available id instead of relying on the global query. This might be a temporary workaround as we are waiting to see if that's an issue that core is willing to fix, as it might affect backwards-compatibility for other vendors. (cherry picked from commit d9e8809) * Update testing notes with new zip file * Add protection against wrong params in get_block_template_fallback() (#11690) * Add protection towards wrong params in get_block_template_fallback() * Improve protection * Update WC Blocks 11.5.1 changelog and testing steps with new fix --------- Co-authored-by: github-actions <[email protected]> Co-authored-by: Lucio Giannotta <[email protected]> Co-authored-by: Albert Juhé Lluveras <[email protected]>
* Empty commit for release pull request * Add readme and testing notes * Bump versions to 11.5.1 * Fix Single Product Classic Template block not showing on the front-end (#11455) In WordPress 6.4, it appears that the global `have_posts` is `false` in the context of the full site editing single product template. This breaks the Classic Template block. In this commit, we are creating a custom query using the available id instead of relying on the global query. This might be a temporary workaround as we are waiting to see if that's an issue that core is willing to fix, as it might affect backwards-compatibility for other vendors. (cherry picked from commit d9e8809) * Update testing notes with new zip file * Add protection against wrong params in get_block_template_fallback() (#11690) * Add protection towards wrong params in get_block_template_fallback() * Improve protection * Update WC Blocks 11.5.1 changelog and testing steps with new fix * bump version * [CYS] Fix decoding issue and pattern (#11681) * Fix pattern description * Decode the actual file content, not the filepath * Use wp_post table instead wp_option to store patterns data generated by AI (#11659) * Use wp_post table instead wp_option to store patterns data generated by AI * avoid crash when there isn't any patterns_ai_data post type * restore check * remove unnecessary constant * catch error * pass boolean to return WP_Error * Rename Centered Header Menu with Search pattern (#11637) * Rename Centered Header Menu with Search pattern Since the search bar has been removed from this pattern, this PR renames the pattern title and slug to reflect that change. * Rename file to reflect search removal. Remove `search` from the filename, as this no longer reflects the pattern. * Add missing condition to avoid a php warning when 'plugins' is not set (#11652) * Fix pattern route performance (#11535) * fix pattern route performance * update namespace * improve middleware * improve ProductSchema * improve error handling * update identifier * fix middleware * update description * use schema to return the response * Break down the generate_content method and create the new fetch_dummy_products_to_update method for handling the fetch of dummy products to be updated. * Ensure the Product endpoint relies on the fetch_dummy_products_to_update method for fetching dummy products to avoid code repetition and add safety checks and handle errors in case certain properties are not available. * Add error handling for the Products endpoint. * Remove memory limit increase and update docblocks. * re-add set_time_limit --------- Co-authored-by: Patricia Hillebrandt <[email protected]> * Empty commit for release pull request * add testing instructions * add zip link --------- Co-authored-by: github-actions <[email protected]> Co-authored-by: Lucio Giannotta <[email protected]> Co-authored-by: Albert Juhé Lluveras <[email protected]> Co-authored-by: Luigi <[email protected]> Co-authored-by: Alba Rincón <[email protected]> Co-authored-by: Daniel W. Robert <[email protected]> Co-authored-by: Patricia Hillebrandt <[email protected]>
* Empty commit for release pull request * Add readme and testing notes * Bump versions to 11.5.1 * Fix Single Product Classic Template block not showing on the front-end (#11455) In WordPress 6.4, it appears that the global `have_posts` is `false` in the context of the full site editing single product template. This breaks the Classic Template block. In this commit, we are creating a custom query using the available id instead of relying on the global query. This might be a temporary workaround as we are waiting to see if that's an issue that core is willing to fix, as it might affect backwards-compatibility for other vendors. (cherry picked from commit d9e8809) * Update testing notes with new zip file * Add protection against wrong params in get_block_template_fallback() (#11690) * Add protection towards wrong params in get_block_template_fallback() * Improve protection * Update WC Blocks 11.5.1 changelog and testing steps with new fix * bump version * [CYS] Fix decoding issue and pattern (#11681) * Fix pattern description * Decode the actual file content, not the filepath * Use wp_post table instead wp_option to store patterns data generated by AI (#11659) * Use wp_post table instead wp_option to store patterns data generated by AI * avoid crash when there isn't any patterns_ai_data post type * restore check * remove unnecessary constant * catch error * pass boolean to return WP_Error * Rename Centered Header Menu with Search pattern (#11637) * Rename Centered Header Menu with Search pattern Since the search bar has been removed from this pattern, this PR renames the pattern title and slug to reflect that change. * Rename file to reflect search removal. Remove `search` from the filename, as this no longer reflects the pattern. * Add missing condition to avoid a php warning when 'plugins' is not set (#11652) * Fix pattern route performance (#11535) * fix pattern route performance * update namespace * improve middleware * improve ProductSchema * improve error handling * update identifier * fix middleware * update description * use schema to return the response * Break down the generate_content method and create the new fetch_dummy_products_to_update method for handling the fetch of dummy products to be updated. * Ensure the Product endpoint relies on the fetch_dummy_products_to_update method for fetching dummy products to avoid code repetition and add safety checks and handle errors in case certain properties are not available. * Add error handling for the Products endpoint. * Remove memory limit increase and update docblocks. * re-add set_time_limit --------- Co-authored-by: Patricia Hillebrandt <[email protected]> * Empty commit for release pull request * add testing instructions * add zip link * [CYS] Fix decoding issue and pattern (#11681) * Fix pattern description * Decode the actual file content, not the filepath * bump version * add changelog * add zip link * add link to the readme --------- Co-authored-by: github-actions <[email protected]> Co-authored-by: Lucio Giannotta <[email protected]> Co-authored-by: Albert Juhé Lluveras <[email protected]> Co-authored-by: Luigi <[email protected]> Co-authored-by: Alba Rincón <[email protected]> Co-authored-by: Daniel W. Robert <[email protected]> Co-authored-by: Patricia Hillebrandt <[email protected]>
Thanks for that fix, is it possible to get them to mainline this, as if we done use it, our sites break. |
@randomburner Can you share with us the error applying this fix or steps to reproduce? Curious what might be the cause. |
@randomburner if by mainline you mean ship the code within WooCommerce, it should be merged as a patch in various version of WooCommerce soon. |
What
In WordPress 6.4, it appears that the global
have_posts
isfalse
in the context of the full site editing single product template. This breaks the Classic Template block.In this PR, we are creating a custom query using the available id instead of relying on the global query.
This might be a temporary workaround as we are waiting to see if that's an issue that core is willing to fix, as it might affect backwards-compatibility for other vendors.
Fixes #11454
Testing Instructions
(Note: styling might not be the best in TT4, but that'd be a separate issue).
WooCommerce Visibility
Required:
Checklist
Required:
[type]
label or a[skip-changelog]
label.Conditional:
[skip-changelog]
label is not present).Changelog
Notes
This PR is a WIP as we wait the result of this conversation: p1698246828170079-slack-C029LRAU2