WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#27972 closed defect (bug) (duplicate)

wp_update_network_user_counts searches non-existent 'deleted', 'spam' columns

Reported by: mkuplens Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0
Component: Networks and Sites Keywords:
Focuses: multisite Cc:
PR Number:

Description

wp_update_network_user_counts executes the following query:

SELECT COUNT(ID) as c FROM $wpdb->users WHERE spam = '0' AND deleted = '0'

The columns in the WHERE statement are not in this table, however, causing the query to fail. The WHERE statement appears to have been copied from wp_update_network_site_counts, where the columns are used to count active, non-spam network sites.

Change History (5)

#1 @DrewAPicture
6 years ago

  • Keywords reporter-feedback added

Hi mkuplens, the spam and deleted columns are both part of the default schema of the Multisite users table. Can you confirm the site you're working with is a Multisite?

#2 @jeremyfelt
6 years ago

Quick note - I'm seeing this same issue on one of my multisite setups, but haven't had a chance to dig in yet. It seems like dbDelta somehow did not modify the tables correctly. My initial guess was some sort of automated install procedure. I'll take a closer look as well.

#3 @mkuplens
6 years ago

Yes, confirmed multisite installation. It's been upgraded through a few releases, so Jeremy's hunch re. dbDelta is in line with my thinking.

#4 @wonderboymusic
5 years ago

  • Keywords needs-patch added; reporter-feedback removed
  • Milestone changed from Awaiting Review to Future Release

#5 @SergeyBiryukov
5 years ago

  • Keywords needs-patch removed
  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #20854.

Note: See TracTickets for help on using tickets.