WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#38246 closed defect (bug) (invalid)

Ensure that the first populated network is a `WP_Network`

Reported by: flixos90 Owned by: flixos90
Milestone: Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords: has-patch
Focuses: multisite Cc:

Description

When the function populate_network() is called on upgrade from single to multisite, the $current_site global is written as a plain object. Since we have WP_Network now, we should ensure it is an instance of that class.

As a site-effect, the number of operations where the global is accessed is reduced so that we can easier replace this by a better mechanism at some point. :)

Attachments (1)

38246.diff (1.0 KB) - added by flixos90 5 years ago.

Download all attachments as: .zip

Change History (4)

@flixos90
5 years ago

#1 @flixos90
5 years ago

  • Keywords has-patch added; needs-patch removed
  • Owner set to flixos90
  • Status changed from new to assigned

38246.diff fixes this.

This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.


5 years ago

#3 @flixos90
5 years ago

  • Milestone 4.7 deleted
  • Resolution set to invalid
  • Status changed from assigned to closed

This was way too rushed - the WP_Network class is not available at this point so we're good with using a plain object here.

While it might make sense to require the multisite-specific function and class files when the network is installed, let's not go down that path just yet as it will need further thought.

Closing this, sorry for the noise. :)

Note: See TracTickets for help on using tickets.