Make WordPress Core

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#46575 closed defect (bug) (fixed)

Issue with WP Export - adding spaces to .xml file

Reported by: juliarrr's profile juliarrr Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.2 Priority: normal
Severity: normal Version: 5.1
Component: Export Keywords: has-patch
Focuses: Cc:

Description

Hello,

After updating WordPress to 5.1 (or 5.1.1) appeared bug with exporting content. When proceeding to the Tools - Export and downloading export .xml file, it can be seen that it exports content incorrectly. Spaces before and after content are added, and it causes problems with importing this content afterwhile. On the screenshot you can see the difference - content on the left was exported on WP 5.0 and content on the right was exported on WP 5.1: https://www.screencast.com/t/jovdKo4Cw . As you can see there are unneeded spaces that break the content structure after import.

Please fix this problem in the next WP update.
Thank you!

Attachments (1)

46575.diff (759 bytes) - added by sgastard 6 years ago.
Remove blank

Download all attachments as: .zip

Change History (11)

@sgastard
6 years ago

Remove blank

#1 @sgastard
6 years ago

  • Keywords has-patch added

#2 @sgastard
6 years ago

#46656 was marked as a duplicate.

#3 @aristath
6 years ago

  • Component changed from General to Export

Just to add to this, this is not limited to <title> elements. As mentioned on https://core.trac.wordpress.org/ticket/46656 the coding-standards fixes in https://core.trac.wordpress.org/changeset?old_path=%2Ftags%2F5.0.3%2Fsrc%2Fwp-admin%2Fincludes%2Fexport.php&old=45013&new_path=%2Ftags%2F5.1.1%2Fsrc%2Fwp-admin%2Fincludes%2Fexport.php&new=45013&sfp_email=&sfph_mail=#file0 result in a lot of whitespace that breaks things on imports - both for menu items as well as content using any page-builder.
It's really annoying having to manually edit the exported XMLs to remove whitespace before importing them on another site - and I'm sure not everyone can do that.

#4 @SergeyBiryukov
6 years ago

#46904 was marked as a duplicate.

#5 @SergeyBiryukov
6 years ago

  • Milestone changed from Awaiting Review to 5.2

#6 @SergeyBiryukov
6 years ago

46575.diff is not enough, running composer format on src/wp-admin/includes/export.php still results in the extra tabs.

Apparently this needs to be adjusted upstream in WPCS: https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.

Version 0, edited 6 years ago by SergeyBiryukov (next)

#8 @SergeyBiryukov
5 years ago

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

In 45216:

Export: Remove extra whitespace from <title>, <content:encoded>, and <excerpt:encoded> elements in WXR files.

Props sgastard, juliarrr, aristath, SergeyBiryukov.
Fixes #46575.

#9 @ocean90
5 years ago

#47031 was marked as a duplicate.

#10 @ocean90
5 years ago

#47209 was marked as a duplicate.

Note: See TracTickets for help on using tickets.