-
Notifications
You must be signed in to change notification settings - Fork 809
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
Fix Upgrade and Subsite Registration Redirects #13333
Conversation
Don't redirect in `Jetpack::activate_default_modules()` when auto-upgrading.
…ration. `Jetpack::activate_default_modules()` redirects on failure, and queues a redirect on success. `Jetpack_Network->do_subsiteregister()` callers are expected to do their own error and success handling, so there's no need to rely on `Jetpack::activate_default_modules()`'s. Fixes #5081.
This state change was gated behind the `$redirect` parameter. We want to set the state regardless.
Only default to redirection in "normal" wp-admin/ requests. Calling code can override to either force `$redirect = true` or `$redirect = false`.
Don't show module state changes to users that can do something with the information.
This is an automated check which relies on |
I think we should get rid of Line 2865 in f892020
It was originally one of several failure redirects. As the code evolved, it (I think accidentally) got attached to the success state as well. I think all calling code handles that redirect independently, so it serves no purpose. I didn't want to do that in this PR, though, so close to 7.7. Much of that module activation code needs cleaning up. It needs better ways to return errors: I don't think the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to work, so I'll be merging this now. I'd love to get more eyes on this during the Beta though.
@iandunn @nickdaugherty @GaryJones Any chance you could test that change in your respective environments during the Beta?
Thank you!
* 7.7 changelog: initial set of changes * Changelog: add #13154 * Changelog: add #13134 * Changelog: add #12699 and many others * Changelog: add #13127 * Changelog: add #13167 * Changelog: add #13225 * Changelog: add #13179 * Changelog: add #13173 * Changelog: add #13232 * Changelog: add #13137 * Changelog: add #13172 * Changelog: add #13182 * Changelog: add #13200 * Changelog: add #13244 * Changelog: add #13267 * Changelog: add #13204 * changelog: add #13205 * Changelog: add #13183 * Changelog: add #13278 * Changelog: add #13162 * Changelog: add #13268 * Changelog: add #13286 * Changelog: add #13273 * Changelog: add #12474 * Changelog: add #13085 * Changelog: add #13266 * Changelog: add #13306 * Changelog: add #13311 * Changelog: add #13302 * Changelog: add #13196 * Changelog: add #12733 * Changelog: add #13261 * Changelog: add #13322 * Changelog: add #13333 * Changelog: add #13335
Apologies @jeherve - I missed your message. 7.8 has been deployed to VIP Go and I didn't notice any redirect issues this time. I believe it only happens when new default modules are activated and I'm not sure if 7.8 had any, but it was a smooth upgrade. Thanks for working on this! |
Fixes #5081.
Changes proposed in this Pull Request:
By default,
Jetpack::activate_default_modules()
redirects on error and queues an eventual redirect on success. This method is called in a few places where those redirects are not desired.init
.Jetpack_Network->do_subsiteregister()
call. Some of these calls are hooked to Core hooks, which can result in unexpected redirect behavior. Calls toJetpack_Network->do_subsiteregister()
should do their own error/success handling.Is this a new feature or does it add/remove features to an existing part of Jetpack?
No: Bug fix.
Testing instructions:
It's a huge pain :(
For
do_subsiteregister()
, create a custom CLI command as in #5081.For upgrade requests, you have to:
wp jetpack options update version 7.6
Prior to this PR, you'll see a
Location
header. Depending on what else is going on on your site, the request will 200, so there won't actually be a redirect, though you can still see the header. (It may 301 is some circumstances, in which case, you will see the redirect.)After this PR, there's no
Location
header and no redirect.Proposed changelog entry for your changes: