Skip to content

Preserved queries in onboarding archives - #195

Merged
pirate-bot merged 1 commit into
developmentfrom
bugfix/187
Oct 29, 2026
Merged

pirate-bot merged 1 commit into
developmentfrom
bugfix/187

Conversation

@girishpanchal30

Copy link
Copy Markdown
Contributor

Summary

Updated the Query Loop settings in the Archive Boxed, Archive Cards, and Archive Row onboarding layouts to use inherit: true, matching the default archive template. These layouts now respect the current archive query, displaying only the relevant category, tag, author, or date archive posts and honoring pagination configured through Settings → Reading.

Closes #187

@pirate-bot

Copy link
Copy Markdown
Contributor

Plugin build for c0489c0 is ready 🛎️!

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes requested

The three archive variants now inherit the archive query, but sites that imported a variant earlier keep the old saved template.

Validation details
  • Files reviewed: 4/4 changed files.
  • The new test passes at HEAD on PHP 7.4.33 and WordPress 7.1.3. use-php.sh 7.4 2>&1 | tail -3; php -v | head -1; cd /var/www/html/wp-content/themes/raft && set -o pipefail; timeout 250… printed OK (1 test, 7 assertions) (run R7)
  • The new test fails with the old template files. cd /var/www/html/wp-content/themes/raft-base && set -o pipefail; timeout 250 vendor/bin/phpunit --filter 'Test_Onboardin… printed Failed asserting that false is true. (run R8)
  • An in-process render of each HEAD variant on a category archive listed only that category's posts, two per page, on pages 1 and 2. cd /var/www/html/wp-content/themes/raft && set -o pipefail; timeout 250 vendor/bin/phpunit --filter 'R2aRenderTest::' 2>… (run R36, exit 0)
Untested areas
  • Enhanced client-side pagination on Archive Cards and Archive Rows was not checked in a browser. The sandbox site did not load Raft over HTTP.

🤖 Automated review · run code-review-agent_6ae0968d9c9388.72620238.


🤖 Review agent — review posted ✅ on c0489c0d · changes requested · 1 finding · 16 min

Run code-review-agent_6ae0968d9c9388.72620238 · trail


<!-- wp:group {"style":{"spacing":{"padding":{"top":"var:preset|spacing|80","bottom":"var:preset|spacing|80","left":"var:preset|spacing|50","right":"var:preset|spacing|50"},"margin":{"top":"0","bottom":"0"}}},"backgroundColor":"raft-bg","layout":{"inherit":true,"type":"constrained"}} -->
<div class="wp-block-group has-raft-bg-background-color has-background" style="margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--80);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--80);padding-left:var(--wp--preset--spacing--50)"><!-- wp:query {"queryId":4,"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false},"layout":{"contentSize":null,"type":"constrained"}} -->
<div class="wp-block-group has-raft-bg-background-color has-background" style="margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--80);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--80);padding-left:var(--wp--preset--spacing--50)"><!-- wp:query {"queryId":4,"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true},"layout":{"contentSize":null,"type":"constrained"}} -->

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correctness This fixes only sites that run onboarding after the update. Otter saves the chosen variant's markup into the site's archive wp_template post at import time. Sites that already picked Archive Boxed, Cards or Rows keep "inherit":false after the update. Their category archives still list posts from all categories. This assumes those sites imported through the same path as Otter v3.2.8. Add a one-time upgrade routine that updates a saved Raft archive template whose Query block still matches a shipped variant with "inherit":false, and sets it to true. Add a PHPUnit case that saves the old variant markup as a wp_template post, runs the routine, and asserts inherit is true.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not applied. Rewriting a site's saved archive template on upgrade would edit content the user owns and may have customised after onboarding, so the theme shouldn't change it silently. This PR fixes all new onboarding selections. Sites that already imported a variant can fix it by re-running onboarding's Archive step, or with "Inherit query from template" on the archive template's Query Loop.

@pirate-bot
pirate-bot merged commit a5f88be into development Oct 29, 2026
10 checks passed
@pirate-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.1.17 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Indicate that an issue has been resolved and released in a particular version of the product.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants