-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#40675: Ensure only the main query is modified when resolving template for new posts. #40799
Conversation
…g template for new posts.
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @petitphp! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
To test, I added the suggested if statement to wp-includes/block-template.php, |
I completely overlooked this 😅, but I just tested following @carolinan's notes, and this fix works as expected. @gziolo @adamziel thoughts on this for 6.0? It's more of a "visual" bug than a critical one in my opinion. The page/post still displays correctly on the frontend. Perhaps we bump to 6.0.1? |
@ndiego, based on the changes applied I assume that the bug existed from WordPress 5.9 so I would vote for including this fix in WP 6.0.1. |
I echo @gziolo, let's ship the fix with WP 6.0.1 |
Perfect, I have moved to the 6.0.1 Project Board. |
Congratulations on your first merged pull request, @petitphp! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts: https://profiles.wordpress.org/me/profile/edit/ And if you don't have a WordPress.org account, you can create one on this page: https://login.wordpress.org/register Kudos! |
@petitphp thank you for your PR! Would you be willing to prepare a backport PR for the https://github.com/WordPress/wordpress-develop repo (6.0 branch)? |
@adamziel Yes I can do that. Is there an existing trac ticket I should mention for the backport or should I create one (asking because I just saw this one https://core.trac.wordpress.org/ticket/56058). Also since this issue is present in the 5.9 should it been backport to this branch too ? |
@adamziel backport PR created WordPress/wordpress-develop#2888 |
Thank you so much @petitphp, good call thinking about a ticket.
Good question 🤔 The way I've seen this handled on the security side of things was to commit to the latest branch first and then one person would backport to all the previous applicable branches. Let's ask directly in that PR! |
I just cherry-picked this PR to the wp/6.0 branch to get it included in the next release: a34e00b |
…e for new posts. This adds a check for the main query in `_resolve_template_for_new_post()` to fix a 404 response when resolving template for new posts or pages caused by the wrong query being modified. Original PR from Gutenberg repository: * [WordPress/gutenberg#40799 #40799: Ensure only the main query is modified when resolving template for new posts] Follow-up to [52316]. Props petitphp, zieladam, poena, ndiego, gziolo, kebbet, Mamaduka, manfcarlo. Merges [53593] to the 6.0 branch. See #56058. git-svn-id: https://develop.svn.wordpress.org/branches/6.0@53594 602fd350-edb4-49c9-b593-d223f7449a82
…e for new posts. This adds a check for the main query in `_resolve_template_for_new_post()` to fix a 404 response when resolving template for new posts or pages caused by the wrong query being modified. Original PR from Gutenberg repository: * [WordPress/gutenberg#40799 #40799: Ensure only the main query is modified when resolving template for new posts] Follow-up to [52316]. Props petitphp, zieladam, poena, ndiego, gziolo, kebbet, Mamaduka, manfcarlo. See #56058. Built from https://develop.svn.wordpress.org/trunk@53593 git-svn-id: https://core.svn.wordpress.org/trunk@53181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…e for new posts. This adds a check for the main query in `_resolve_template_for_new_post()` to fix a 404 response when resolving template for new posts or pages caused by the wrong query being modified. Original PR from Gutenberg repository: * [WordPress/gutenberg#40799 #40799: Ensure only the main query is modified when resolving template for new posts] Follow-up to [52316]. Props petitphp, zieladam, poena, ndiego, gziolo, kebbet, Mamaduka, manfcarlo. See #56058. Built from https://develop.svn.wordpress.org/trunk@53593 git-svn-id: https://core.svn.wordpress.org/trunk@53181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…e for new posts. This adds a check for the main query in `_resolve_template_for_new_post()` to fix a 404 response when resolving template for new posts or pages caused by the wrong query being modified. Original PR from Gutenberg repository: * [WordPress/gutenberg#40799 #40799: Ensure only the main query is modified when resolving template for new posts] Follow-up to [52316]. Props petitphp, zieladam, poena, ndiego, gziolo, kebbet, Mamaduka, manfcarlo. Merges [53593] to the 6.0 branch. See #56058. Built from https://develop.svn.wordpress.org/branches/6.0@53594 git-svn-id: https://core.svn.wordpress.org/branches/6.0@53182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…e for new posts. This adds a check for the main query in `_resolve_template_for_new_post()` to fix a 404 response when resolving template for new posts or pages caused by the wrong query being modified. Original PR from Gutenberg repository: * [WordPress/gutenberg#40799 #40799: Ensure only the main query is modified when resolving template for new posts] Follow-up to [52316]. Props petitphp, zieladam, poena, ndiego, gziolo, kebbet, Mamaduka, manfcarlo. Merges [53593] to the 6.0 branch. See #56058. Built from https://develop.svn.wordpress.org/branches/6.0@53594 git-svn-id: https://core.svn.wordpress.org/branches/6.0@53182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…e for new posts. This adds a check for the main query in `_resolve_template_for_new_post()` to fix a 404 response when resolving template for new posts or pages caused by the wrong query being modified. Original PR from Gutenberg repository: * [WordPress/gutenberg#40799 #40799: Ensure only the main query is modified when resolving template for new posts] Follow-up to [52316]. Props petitphp, zieladam, poena, ndiego, gziolo, kebbet, Mamaduka, manfcarlo. Merges [53593] to the 6.0 branch. See #56058. Built from https://develop.svn.wordpress.org/branches/6.0@53594
…e for new posts. This adds a check for the main query in `_resolve_template_for_new_post()` to fix a 404 response when resolving template for new posts or pages caused by the wrong query being modified. Original PR from Gutenberg repository: * [WordPress/gutenberg#40799 #40799: Ensure only the main query is modified when resolving template for new posts] Follow-up to [52316]. Props petitphp, zieladam, poena, ndiego, gziolo, kebbet, Mamaduka, manfcarlo. See #56058. Built from https://develop.svn.wordpress.org/trunk@53593
…e for new posts. This adds a check for the main query in `_resolve_template_for_new_post()` to fix a 404 response when resolving template for new posts or pages caused by the wrong query being modified. Original PR from Gutenberg repository: * [WordPress/gutenberg#40799 #40799: Ensure only the main query is modified when resolving template for new posts] Follow-up to [52316]. Props petitphp, zieladam, poena, ndiego, gziolo, kebbet, Mamaduka, manfcarlo. Merges [53593] to the 6.0 branch. See #56058. Built from https://develop.svn.wordpress.org/branches/6.0@53594 git-svn-id: https://core.svn.wordpress.org/branches/6.0@53182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
What?
Fix 404 response when resolving template for new posts/pages (#40675).
This issue has been reported with WordPress 6.0 beta 3 and can still be reproduced in RC1.
Since the bug only occur with the Gutenberg plugin disable, this PR would need to be backported into WordPress core to fix the original issue.