WordPress.org

Make WordPress Core

#23683 closed defect (bug) (fixed)

Fatal error in WP_User_Query

Reported by: SergeyBiryukov Owned by: SergeyBiryukov
Milestone: 3.5.2 Priority: normal
Severity: normal Version: 3.4
Component: Users Keywords: has-patch commit fixed-major
Focuses: Cc:

Description

To reproduce in single site:

  1. Go to Users screen.
  2. Enter a URL into the search input and click "Search Users".
  3. You'll see a fatal error:
    Fatal error: Call to undefined function wp_is_large_network() in wp-includes/user.php on line 477
    

wp_is_large_network() is only defined in Multisite admin:
http://core.trac.wordpress.org/browser/tags/3.5.1/wp-admin/includes/ms.php#L696

This can be reproduced when using WP_User_Query on front-end as well (in single site and Multisite). Introduced in [19886].

Attachments (3)

23683.patch (2.0 KB) - added by SergeyBiryukov 14 months ago.
23683.2.patch (2.7 KB) - added by SergeyBiryukov 13 months ago.
23683.diff (828 bytes) - added by nacin 10 months ago.

Download all attachments as: .zip

Change History (16)

SergeyBiryukov14 months ago

comment:1 SergeyBiryukov14 months ago

23683.patch moves the function to ms-functions.php, which could also help in #22917.

comment:2 nacin14 months ago

  • Milestone changed from 3.6 to 3.5.2

comment:3 ryan14 months ago

Looks good.

comment:4 SergeyBiryukov14 months ago

  • Keywords commit added

SergeyBiryukov13 months ago

comment:5 SergeyBiryukov13 months ago

23683.patch doesn't actually fix the error in single site. 23683.2.patch should do that.

comment:6 nacin13 months ago

Might be easier to read as:

elseif ( preg_match('|^https?://|', $search) && ! ( is_multisite() && wp_is_large_network( 'users' ) ) )

comment:7 SergeyBiryukov13 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 23664:

Fix fatal error in WP_User_Query when searching users by URL. Move wp_is_large_network() to wp-includes. fixes #23683 for trunk.

comment:8 SergeyBiryukov13 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for 3.5.2 consideration.

comment:9 nacin13 months ago

  • Keywords fixed-major added

nacin10 months ago

comment:10 nacin10 months ago

Let's be a bit more conservative for 3.5.2 and simply aim to avoid the fatal error: 23683.diff.

The problem with moving a function from one file to another is that if the update fails in some very unexpected and uncaught way, the function could suddenly exist twice, which will result in fatal errors. I'd rather try to just fix the fatal without possibly introducing others in a minor release. (Checksums would, of course, make this better.)

comment:11 nacin10 months ago

Sergey signed off on the plan in IRC.

comment:12 nacin10 months ago

In 24441:

Avoid a fatal error in WP_User_Query. See #23683, [23664]. For the 3.5 branch.

comment:13 nacin10 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.