Opened 3 years ago
Closed 2 years ago
#14847 closed enhancement (fixed)
Update featured image data in WXR import
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | WordPress.org |
| Component: | Import | Version: | |
| Severity: | normal | Keywords: | has-patch gci |
| Cc: |
Attachments (2)
Change History (8)
- Component changed from Export to Import
- Milestone changed from Awaiting Review to WordPress.org site
- Summary changed from Add featured image data to WXR export to Update featured image data in WXR import
comment:2
Nano8Blazex — 2 years ago
- Keywords has-patch gci added
Also, something I noticed:
The importer replaces conflicting attachment URLs only once... meaning that on imports of new posts with an attachment that's already imported, the URL doesn't change and remains pointed to the original image on the original site.
My patch (my fourth one ever! so don't expect too much) has a similar problem -> If the post or page is reimported, and the image isn't reuploaded, the post's featured image data is overwritten and the problem resumes. I honestly don't know how to fix this.
This is hard to explain. It might not be a problem, considering that most people probably import another wordpress blog only once and don't try again.
Looking good (especially for your fourth patch!). Just a couple of things:
- The new id_remap is actually unnecessary; look in process_posts for what you can use that's already there
- I think it would be more efficient to make use of isset rather than the inner loop when updating the _thumbnail_id meta
From what you say about this other problem don't worry about it as it's beyond the scope of this task. I will do some testing and look into a fix.
comment:4
follow-up:
↓ 5
Nano8Blazex — 2 years ago
Better? I'm having a hard time testing it, however hard I try I can't seem to get different ids when importing right now, so this revised patch isn't tested. :D
Replying to Nano8Blazex:
Better? I'm having a hard time testing it, however hard I try I can't seem to get different ids when importing right now, so this revised patch isn't tested. :D
First impression is that it looks good and will work nicely. Will do some testing and then close the task as completed.
Thanks :)
- Resolution set to fixed
- Status changed from new to closed

The _thumbnail_id post meta is being exported, it's just that on importing this is not being updated to reflect the new ID of the attachment so it refuses to display. This should be relatively easy to fix since we already do things like replacing attachment URLs. Patch coming soon.