WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#21960 closed defect (bug) (fixed)

Exporter doesn't exclude auto-drafts when calculating the authors list

Reported by: westi Owned by: westi
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: Export Keywords: has-patch
Focuses: Cc:

Description

The exported correctly excludes auto-drafts from the file but not when calculating the list of authors on the blog.

This means the export file can have a list of authors which doesn't match those on the blog and can include users that might not be expected when the WordPress install has multisite enabled as auto-drafts can get created for Super Admins on other users blogs.

Attachments (2)

21960.diff (568 bytes) - added by westi 9 years ago.
Simple patch to fix this issue
export.php (2.8 KB) - added by westi 9 years ago.
"Unit Tests" that can't be committed because the function is not testable.

Download all attachments as: .zip

Change History (6)

@westi
9 years ago

Simple patch to fix this issue

@westi
9 years ago

"Unit Tests" that can't be committed because the function is not testable.

#1 follow-up: @westi
9 years ago

I wrote some tests for this (attached) but we can really use them at the moment because these functions are defined inside export_wp and that throws headers already sent errors and phpunit marks the test as having errors.

Ideally we should make these functions more globally available - the export includes are only included when we load export.php anyway.

#2 in reply to: ↑ 1 @nacin
9 years ago

Replying to westi:

I wrote some tests for this (attached) but we can really use them at the moment because these functions are defined inside export_wp and that throws headers already sent errors and phpunit marks the test as having errors.

Ideally we should make these functions more globally available - the export includes are only included when we load export.php anyway.

Yep, they should just be pulled into export.php. Defining functions inside functions is a pretty silly endeavor.

#3 @westi
9 years ago

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

In [21946]:

Export: Ignore auto-drafts when building the list of users for the export file. Fixes #21960.

#4 @johnbillion
9 years ago

Further enhancement to this: #20206 (albeit an older ticket)

Note: See TracTickets for help on using tickets.