Opened 22 months ago

Last modified 6 months ago

#18242 new defect (bug)

Changing domain for a network blog make faulty changes in database

Reported by: darkwhispering Owned by:
Priority: normal Milestone: Future Release
Component: Multisite Version: 3.0
Severity: major Keywords: has-patch dev-feedback
Cc: marko@…, coenjacobs@…

Description

When changing the domain for a network blog, if the network is set up on a subdomain and using sub-folder options for blogs, the save to the database is faulty, saving wrong urls.

The network main site uses eg http://my.blog.com and the blogs has http://my.blog.com/blog1

When changing the domain for blog1 in "Network admin -> All Sites -> Edit blog1" and choose to also update "home and siteurl" the new url for home and site become http://blog.com/blog1/my

Happens in both Firefox 5 and Safari 5.1

Attachments (2)

18242.patch (624 bytes) - added by SergeyBiryukov 22 months ago.
18242.2.patch (862 bytes) - added by SergeyBiryukov 22 months ago.

Download all attachments as: .zip

Change History (14)

Cannot reproduce. Have you tried with all plugins deactivated?

All plugins is deactivated and the installation is fresh, but it is local, forgot to mention that is the above description.

I and a co-worker of mine have this bug/problem with fresh localhost WP install on Mac OS X Snow Leopard and Lion using the built-in apache and mysql.

I've created the exact same structure on a local installation of 3.3-trunk, but whatever I enter into Domain and Path fields for blog1 and whether I check “Update siteurl and home as well” or not, it just saves what I entered.

I may be missing some step. What are the domain and path you set there?

  1. Installing WP in a subdomain like http://my.blog.com
  2. Turn it into a Network with the subfolder option so the future blogs will have http://my.blog.com/blog1
  3. For the "blog1" in network admin I change domain to http://my.blog.org and leave the path as it is (blog1)
  4. Check the "update siteurl and home as well" checkbox
  5. Update
  6. Taking a look in the database, and the siteurl and home url now looks "http://blog.org/blog1/my

I have not yet done a new install myself, will do that soon, and then try this again to see what happens.

  • Keywords needs-patch added

Ah, I didn't look in the database, because Edit Site screen still displayed valid data. Now I see it.

Ah, yes. The site displays right, but the data in the database get saved wrong.

  • Keywords has-patch added; needs-patch removed

Introduced in [12978] as a fix #12119:

$blog_address = get_blogaddress_by_domain($_POST['blog']['domain'], $_POST['blog']['path']); 

This is the only place in core where get_blogaddress_by_domain() is used.

Related WPMU changeset:
r266. If I had to guess, it has something to do with WPMU working in a subfolder.

Not sure if it's a good idea to change get_blogaddress_by_domain() due to backward compatibility reasons, so I've attached patches with two different attempts to fix the issue.

  • Cc marko@… added
  • Keywords dev-feedback added
  • Severity changed from normal to major
  • Version changed from 3.2.1 to 3.3

In my opinion opinion this should be fix soon. This will break WordPress functionality since the url can't be access.

  • Cc coenjacobs@… added
  • Milestone changed from Awaiting Review to 3.4
  • Version changed from 3.3 to 3.0

Version number indicates when the bug was initially introduced.

  • Milestone changed from 3.4 to Future Release
Note: See TracTickets for help on using tickets.