Skip to content
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

Sticky cache after changing a network's domain/path #115

Open
kraftbj opened this issue Mar 20, 2017 · 2 comments
Open

Sticky cache after changing a network's domain/path #115

kraftbj opened this issue Mar 20, 2017 · 2 comments
Assignees
Milestone

Comments

@kraftbj
Copy link
Contributor

kraftbj commented Mar 20, 2017

After changing the domain/path of a network via

function update_network( $id, $domain, $path = '' ) {
, the old URL was still being populated via
$domain = ! empty( $network->domain )
until running wp_cache_flush.

We run clean_network_cache, which sounds like it should take care of it, but didn't. Still digging around on it.

@kraftbj
Copy link
Contributor Author

kraftbj commented Mar 20, 2017

This has a secondary issue that can leave you in a weird situation.

  1. Change the network domain/path from example.com to example.coms.
  2. On the page reload, the cache will still display example.com for the network domain/path (though the individual subsites below will display .coms URL).
  3. Submit update, which has example.com still in error.
  4. The network domain/path accepts the change, but the individual subsites do not change. I think it is due to this conditional
    if ( $network->domain !== $domain ) {
  5. The result is the domain/path is set as example.com while the subsites are on .coms.

There is no way to retrigger the loop to update the domain on all subsites. If you edit it to, say, example.test, the subsites would update to example.tests. In this example, the s at the end of the URL would always remain.

To resolve, need to edit the db (_blogs and the specific blog's options table) to change the URL of the primary site to the correct domain, then you can update the others through the UI for each site.

@JJJ JJJ self-assigned this May 11, 2018
@JJJ JJJ added this to the 3.0.0 milestone May 11, 2018
@JJJ
Copy link
Collaborator

JJJ commented Aug 25, 2021

I've made a few modifications here.

Instead of calling refresh_blog_details() we are now calling clean_blog_cache() directly.

Curious if you have a better experience once 2.5.0 is released. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants