Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#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:


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:

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 9 years ago.
23683.2.patch (2.7 KB) - added by SergeyBiryukov 9 years ago.
23683.diff (828 bytes) - added by nacin 8 years ago.

Download all attachments as: .zip

Change History (16)

#1 @SergeyBiryukov
9 years ago

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

#2 @nacin
9 years ago

  • Milestone changed from 3.6 to 3.5.2

#3 @ryan
9 years ago

Looks good.

#4 @SergeyBiryukov
9 years ago

  • Keywords commit added

#5 @SergeyBiryukov
9 years ago

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

#6 @nacin
9 years ago

Might be easier to read as:

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

#7 @SergeyBiryukov
9 years 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.

#8 @SergeyBiryukov
9 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for 3.5.2 consideration.

#9 @nacin
8 years ago

  • Keywords fixed-major added

8 years ago

#10 @nacin
8 years 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.)

#11 @nacin
8 years ago

Sergey signed off on the plan in IRC.

#12 @nacin
8 years ago

In 24441:

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

#13 @nacin
8 years ago

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