Make WordPress Core

Opened 3 years ago

Last modified 12 months ago

#52470 new defect (bug)

Exported WXR contains terms twice

Reported by: karl94's profile karl94 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Export Keywords: has-patch
Focuses: Cc:

Description

How to reproduce: after a fresh WordPress install (no active plugins) go make a WXR export file. If you open the WRX file you'll notice the Uncategorized appears twice: the first time as wp:category element, the second as a wp:term.
The wp:category comes from https://github.com/WordPress/WordPress/blob/5.6.1/wp-admin/includes/export.php#L158, the wp:term from https://github.com/WordPress/WordPress/blob/5.6.1/wp-admin/includes/export.php#L162-L167. With the setup described (no plugins) the only registered taxonomies are the builtin ones, therefore $custom_taxonomies contains an empty array. When get_terms() receives an empty array as the taxonomies param it will return all terms, of every taxonomy.
This also means that if there are other taxonomies registered the issue doesn't show up.

This is a regression: on WordPress 4.4 it doesn't happen.
A git bisect pointed to https://github.com/WordPress/WordPress/commit/3f7441d674d304a8ad0912831aa9685cdc8bff93 as the culprit.
The commit states that it maintains backwards compatibility, but it does not in case an empty array is passed as taxonomy param.

Change History (3)

#1 @sabernhardt
3 years ago

  • Component changed from General to Export

#2 @hellofromTonya
3 years ago

  • Version trunk deleted

Removing trunk as the Version as predates 5.7 (current trunk). Actual trunk can be set once root cause is identified.

This ticket was mentioned in PR #4969 on WordPress/wordpress-develop by decodekult.


12 months ago
#3

  • Keywords has-patch added

When exporting all content and no custom taxonomies are defined.

Note: See TracTickets for help on using tickets.