Changes between Initial Version and Version 1 of Ticket #64390
- Timestamp:
- 12/09/2025 10:47:01 PM (2 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #64390
- Property Focuses template added
-
Property
Component
changed from
GeneraltoPosts, Post Types
-
Ticket #64390 – Description
initial v1 1 This is mostly for informational purposes. The SQL changes in https://core.trac.wordpress.org/changeset/61066caused an infinite loop in a number of WooCommerce themes (Storefront and its derivatives, among others) that were relying on the existing behavior to handle adjacent product links. I don't think this was a predictable outcome, but is one that should be considered going forward when publishing Field Guides and making SQL changes to core.1 This is mostly for informational purposes. The SQL changes in [61066] for #8107 caused an infinite loop in a number of WooCommerce themes (Storefront and its derivatives, among others) that were relying on the existing behavior to handle adjacent product links. I don't think this was a predictable outcome, but is one that should be considered going forward when publishing Field Guides and making SQL changes to core. 2 2 3 The affected themes used a filter on get_{$adjacent}_post_where to advance the product search past the date (using < or > comparators) of a currently found-but-hidden adjacent product, ensuring that the search can continue down the chain of posts. When the SQL change was made, it became possible to find an invalid (hidden) post with the **same** date as the current global $post. Because the date was no longer a reliable barrier to selecting the same invalid post, each attempt to find a previous product substituted the same date that was already present in the query, running the same search while never advancing any further. When combined with Storefront's lack of any looping protections, this lead to an infinite loop on certain product pages where the next product down the line had the same timestamp as the current product and was a hidden product.3 The affected themes used a filter on `get_{$adjacent}_post_where` to advance the product search past the date (using < or > comparators) of a currently found-but-hidden adjacent product, ensuring that the search can continue down the chain of posts. When the SQL change was made, it became possible to find an invalid (hidden) post with the **same** date as the current global `$post`. Because the date was no longer a reliable barrier to selecting the same invalid post, each attempt to find a previous product substituted the same date that was already present in the query, running the same search while never advancing any further. When combined with Storefront's lack of any looping protections, this lead to an infinite loop on certain product pages where the next product down the line had the same timestamp as the current product and was a hidden product. 4 4 5 5 Storefront has been updated in https://github.com/woocommerce/storefront/pull/2202, but many of the derivative themes may not be aware of the issue. 6 6 7 To reproduce, products in the same category should have the same post_date, and one should have Catalog visibility: Hiddenset. Visiting a product page adjacent to the hidden one will cause this loop.7 To reproduce, products in the same category should have the same `post_date`, and one should have Catalog `visibility: hidden` set. Visiting a product page adjacent to the hidden one will cause this loop. 8 8 9 9 Related reports: