Skip to content

Conversation

@n7studios
Copy link
Contributor

Summary

Testing in 6.9 RC1 raised a SQL error when using Member Content and modifying the get_adjacent_post() query to determine the previous/next page links within a course (series of WordPress pages gated by form, tag or product):

Screenshot 2025-11-13 at 22 18 15

This is due to a change in the original query, before modification:

  • 6.8 and lower: WHERE p.post_date < '2025-11-13 14:07:58' AND p.post_type = 'page' AND ( p.post_status = 'publish' OR p.post_status = 'private' )
  • 6.9 and newer: WHERE (p.post_date < '2025-11-13 14:04:15' OR (p.post_date = '2025-11-13 14:04:15' AND p.ID < 3)) AND p.post_type = 'page' AND ( p.post_status = 'publish' OR p.post_status = 'private' )

The replacement WHERE clause was too generic in replacing part of the query on the first AND.

This PR resolves by using a more specific search and replace, and submitted here to backport test against 6.8.

Testing

Existing tests pass.

Checklist

@n7studios n7studios self-assigned this Nov 13, 2025
@n7studios n7studios added the bug label Nov 13, 2025
@n7studios n7studios changed the base branch from main to tests-improve-reliability November 18, 2025 07:39
@github-actions
Copy link

WordPress Playground

🚀 Your PR has been built and is ready for testing in WordPress Playground!

Click here to test your changes in WordPress Playground

@n7studios n7studios requested review from a team, corydhmiller and noelherrick and removed request for a team November 18, 2025 09:11
@n7studios n7studios marked this pull request as ready for review November 18, 2025 09:11
@n7studios n7studios merged commit 28a0a01 into tests-improve-reliability Nov 19, 2025
223 of 227 checks passed
@n7studios n7studios deleted the restrict-content-prev-next-link-compat-6-9 branch December 5, 2025 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants