[wp-trac] [WordPress Trac] #32704: Upload path is not set correctly after switch_blog

WordPress Trac noreply at wordpress.org
Fri Jul 10 22:08:18 UTC 2015


#32704: Upload path is not set correctly after switch_blog
--------------------------+------------------------------
 Reporter:  ilanco        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Upload        |     Version:  3.0
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:  multisite
--------------------------+------------------------------
Changes (by jeremyfelt):

 * keywords:   => needs-patch
 * version:  trunk => 3.0
 * component:  General => Upload


Comment:

 Hi @ilanco, thanks for the report. This is going to take some time to
 really dig into, so I don't have a great explanation immediately. This has
 existed for many releases and
 [https://core.trac.wordpress.org/ticket/21459#comment:44 has never worked]
 because of how constants are used to build the URLs when using the old ms-
 files. Even with the attached patch, the `BLOGUPLOADDIR` constant has
 already been set in the context of the first site and will be used even
 when building the URL for the switched site.

 It may be possible to look for a default value for `BLOGUPLOADDIR` that
 contains the text `wp-content/blogs.dir/#/files/` and replace that for use
 in `$dir` with current site's ID. I'm a little worried at what the
 consequences from that may be, though I haven't though through it too
 much. I'd much rather see that implemented by a plugin on the `upload_dir`
 filter first.

 Switching is supported as of the deprecation of `ms-files.php` in #19235.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32704#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list