[wp-trac] [WordPress Trac] #27003: Introduce wp_get_network() and begin cleanup of multisite load

WordPress Trac noreply at wordpress.org
Mon Mar 3 21:31:20 UTC 2014


#27003: Introduce wp_get_network() and begin cleanup of multisite load
----------------------------+------------------------
 Reporter:  jeremyfelt      |       Owner:
     Type:  task (blessed)  |      Status:  new
 Priority:  normal          |   Milestone:  3.9
Component:  Bootstrap/Load  |     Version:  trunk
 Severity:  normal          |  Resolution:
 Keywords:  needs-testing   |     Focuses:  multisite
----------------------------+------------------------

Comment (by gradyetc):

 Replying to [comment:32 nacin]:
 > In [changeset:"27359"]:
 > {{{
 > #!CommitTicketReference repository="" revision="27359"
 > Introduce get_site_by_path() and further rewrite the site detection
 process for multisite.
 >
 > This is the first big step to supporting arbitrary domains and paths. In
 this new approach, sites are detected first where possible, then the
 network is inferred. Allows filtering for arbitrary path segments, smooths
 out some weirdness, and removes various restrictions. A sunrise plugin
 could do much of its work by adding filters, if those are even needed.
 >
 > see #27003.
 > }}}

 This commit introduced a bug in `wp-includes/ms-settings.php`:

 {{{
 if ( ! $current_site = wp_cache_get( 'current_network', 'site-options' ) )
 {
         // Are there even two networks installed?
         $one_network = $wpdb->get_row( "SELECT * FROM $wpdb->site LIMIT 2"
 ); // [sic]
         if ( 1 === $wpdb->num_rows ) {
                 $current_site = wp_get_network( $one_network );
                 wp_cache_set( 'current_network', 'site-options' );
         } elseif ( 0 === $wpdb->num_rows ) {
                 ms_not_installed();
         }
 }
 }}}

 The call to `wp_cache_set` on line 78 is missing the `$data` argument.

 It should be:
 {{{
 wp_cache_set( 'current_network', $current_site, 'site-options' );
 }}}

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


More information about the wp-trac mailing list