Fix post template max per page to stay within query limits#3
Merged
roborourke merged 4 commits intomainfrom Jan 15, 2026
Merged
Conversation
When multiple post templates exist within a query loop, each subsequent template now correctly limits its maximum posts per page based on remaining posts from the query loop total. Editor changes: - Calculate remaining posts available for each post template - Set max value for per page input based on remaining posts - Use UsedPostsContext to track preceding post templates Server-side changes: - Track post template per page settings per query loop - Calculate remaining posts for templates without explicit per page setting - Apply remaining post limit to prevent exceeding query loop total
Playwright test resultsDetails
|
This test verifies that when a query loop has a posts per page limit and post templates don't have explicit per page settings, the server-side calculation automatically limits them to the remaining posts. Test scenario: - Query loop with 6 posts per page - First post template: 1 post (explicit) - Second post template: 2 posts (explicit) - Third post template: no setting (auto-calculates to 3 remaining) - Result: exactly 6 unique posts displayed
Remove the query loop posts per page configuration step that was causing timeouts and update assertions to expect 10 total posts using the default posts_per_page setting. This still validates the automatic calculation: - First template: 1 post (explicit) - Second template: 2 posts (explicit) - Third template: 7 posts (auto-calculated: 10 - 1 - 2) - Total: 10 unique posts
tomjn
approved these changes
Jan 15, 2026
Contributor
|
LGTM 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.