[wp-trac] [WordPress Trac] #40279: switch_to_blog() and restore_current_blog() gives a fatal error in a multisite

WordPress Trac noreply at wordpress.org
Tue Mar 28 19:34:30 UTC 2017


#40279: switch_to_blog() and restore_current_blog() gives a fatal error in a
multisite
--------------------------------+------------------------
 Reporter:  KestutisIT          |       Owner:
     Type:  defect (bug)        |      Status:  closed
 Priority:  normal              |   Milestone:
Component:  Networks and Sites  |     Version:
 Severity:  normal              |  Resolution:  wontfix
 Keywords:  close               |     Focuses:  multisite
--------------------------------+------------------------
Changes (by johnbillion):

 * status:  reopened => closed
 * resolution:   => wontfix


Comment:

 @KestutisIT Thanks for being passionate about improving WordPress!

 With Multisite enabled, WordPress operates in a very different manner to a
 single site installation. In your code example, what return value is
 expected from `$this->conf->getBlogId()` on a single site installation?
 Single site installations don't even have the ''concept'' of a blog ID, so
 the application logic here is flawed.

 It may make more sense for single site installations to also operate with
 the concept of a blog ID, purely so interoperability with multisite
 installations is improved, but that ship sailed about 7 years ago.

 The somewhat confusing error message you're seeing is due to PHP
 attempting to resolve the procedural function name in the current
 namespace after attempting to resolve it in the global namespace, before
 throwing the fatal error. You'll see the same format error in any
 situation where you attempt to call an undefined function from within a
 namespace.

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


More information about the wp-trac mailing list