Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#32281 closed defect (bug) (fixed)

get_blogs_of_user should not set archived, spam and delete to 0

Reported by: realloc's profile realloc Owned by: jeremyfelt's profile jeremyfelt
Milestone: 4.3 Priority: normal
Severity: normal Version: 3.5
Component: Users Keywords: has-patch needs-testing
Focuses: multisite Cc:


get_blogs_of_user creates blog-objects and adds them to an array right after a call of get_blog_details. It uses all data of that function but sets the properties archived, spam and delete to 0 even if this is not true.

Attachments (1)

32281.patch (1.6 KB) - added by realloc 9 years ago.
Patch and unit-test

Download all attachments as: .zip

Change History (3)

9 years ago

Patch and unit-test

#1 @jeremyfelt
9 years ago

  • Focuses multisite added
  • Keywords has-patch needs-testing added
  • Milestone changed from Awaiting Review to 4.3
  • Version changed from trunk to 3.5

Hi @realloc, thanks for the ticket and patch and tests!

At first glance, this seems to make sense. I'm not sure that we have any other reasoning for setting everything to 0 other than something was necessary to avoid notices (see #16225). Otherwise, the same method of providing data has existed since [15671].

I'm going to bump this to 4.3, but sit on it for a bit to make sure we're not missing anything.

#2 @jeremyfelt
9 years ago

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

In 32626:

Provide all site flag data in objects returned by get_blogs_of_user()

Previously, archived, spam, and deleted properties were forced to 0 when returned by get_blogs_of_user(). This was originally introduced in [21794] as a way to prevent notices when properties were expected.

Instead, we can properly fill these properties with those retrieved from get_blog_details().

Props realloc.
Fixes #32281.

Note: See TracTickets for help on using tickets.