[wp-trac] [WordPress Trac] #34065: Upgrading from single site to multisite fails when the Network Admin Email doesn't match an existing user.
WordPress Trac
noreply at wordpress.org
Mon Sep 28 22:41:31 UTC 2015
#34065: Upgrading from single site to multisite fails when the Network Admin Email
doesn't match an existing user.
---------------------------------------+-----------------------------
Reporter: jjeaton | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Networks and Sites | Version: trunk
Severity: normal | Keywords:
Focuses: administration, multisite |
---------------------------------------+-----------------------------
While the Network Admin Email is a freeform input field, it appears to
only work if used with the email of an existing user. In the current
state, the network's main site isn't configured correctly if set up with
an email that doesn't exist for a user.
The function `populate_network` is using the network admin email to
retrieve a user and with that user it's setting:
- The super admins for the main site
- The admin_email
- The admin_user_id
- Setting the 'source_domain' in that user's meta.
- Setting the 'primary_blog' in that user's meta.
All of those except `admin_email` require an existing user. To fix we
should check whether the email exists for an existing user, if not, bail
with an error. This is similar to what happens if the field is submitted
with something that doesn't pass email validation.
We could also consider changing the input field to use autocomplete, and
only allow selecting of email addresses for users that exist, as it
appears that on initial upgrade, Network Admin Email should be an email
for an existing user. We could also update the field to indicate that
requirement.
'''Steps to reproduce:'''
1. Install WordPress.
2. Add `define( 'WP_ALLOW_MULTISITE', true );` to wp-config.php
3. Navigate to `/wp-admin/network.php`
4. Leave the defaults, but change the 'Network Admin Email' to an email
address that isn't used for any user already in the database.
5. Click 'Install'.
'''Actual Results'''
The page reloads with 6 notices in schema.php, see screenshot below. Also
because of how the `$site_user` data is used, the sitemeta for the main
site becomes invalid.
[[Image(https://cldup.com/Srsks9TLID-1200x1200.png)]]
'''Questions:'''
- Even after the initial upgrade, is Network Admin Email required to be
associated with an existing user?
- If not, is there another way to upgrade to multisite and not require the
Network Admin Email to be associated with a user? Is that something worth
pursuing or should we just fix the messaging and enforce it?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34065>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list