Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

Importing attachments results in faulty file references #62

Open
maartenbusstra opened this issue Feb 21, 2017 · 3 comments
Open

Importing attachments results in faulty file references #62

maartenbusstra opened this issue Feb 21, 2017 · 3 comments

Comments

@maartenbusstra
Copy link

maartenbusstra commented Feb 21, 2017

Hi, I have the following problem:

I'm trying to import attachments, but for some reason the imports aren't referenced correctly in the corresponding posts, or the directory in which they end up is incorrect. I'm getting this error:

WPOS3: File /app/web/app/uploads/Casper-van-Eijck-in-actie-0115-007.jpg does not exist.

WP Offload S3 is looking for the file, but can't find where it's supposed to be. Neither are they showing up correctly in wp-admin.

Example:

width: 2953
height: 1969
file: 2017/02/Casper-van-Eijck-in-actie-0115-007.jpg
sizes:
    thumbnail: { file: Casper-van-Eijck-in-actie-0115-007-300x300.jpg, width: 300, height: 300, mime-type: image/jpeg }
    medium: { file: Casper-van-Eijck-in-actie-0115-007-875x583.jpg, width: 875, height: 583, mime-type: image/jpeg }
    medium_large: { file: Casper-van-Eijck-in-actie-0115-007-1280x853.jpg, width: 1280, height: 853, mime-type: image/jpeg }
    large: { file: Casper-van-Eijck-in-actie-0115-007-1280x853.jpg, width: 1280, height: 853, mime-type: image/jpeg }
    thumbnail_uncropped: { file: Casper-van-Eijck-in-actie-0115-007-300x200.jpg, width: 300, height: 200, mime-type: image/jpeg }
    home_small: { file: Casper-van-Eijck-in-actie-0115-007-540x405.jpg, width: 540, height: 405, mime-type: image/jpeg }
    home_large: { file: Casper-van-Eijck-in-actie-0115-007-1125x640.jpg, width: 1125, height: 640, mime-type: image/jpeg }
    large_cropped: { file: Casper-van-Eijck-in-actie-0115-007-900x900.jpg, width: 900, height: 900, mime-type: image/jpeg }
    article__header__xl: { file: Casper-van-Eijck-in-actie-0115-007-1600x900.jpg, width: 1600, height: 900, mime-type: image/jpeg }
    article__header__l: { file: Casper-van-Eijck-in-actie-0115-007-1600x600.jpg, width: 1600, height: 600, mime-type: image/jpeg }
    article__header__m: { file: Casper-van-Eijck-in-actie-0115-007-1600x400.jpg, width: 1600, height: 400, mime-type: image/jpeg }
    share: { file: Casper-van-Eijck-in-actie-0115-007-1200x630.jpg, width: 1200, height: 630, mime-type: image/jpeg }
image_meta:
    aperture: '0'
    credit: 'Levien Willemse'
    camera: ''
    caption: ''
    created_timestamp: '0'
    copyright: "Rochussenstraat 315-b\n3023 DG Rotterdam Holland\n010-4779415   06-53 301015"
    focal_length: '0'
    iso: '0'
    shutter_speed: '0'
    title: ''
    orientation: '0'
    keywords: {  }

It seems like _wp_attached_file (and the file keys in sizes?) is being set incorrectly.

Import log:

[2017-02-21 11:42:55] w2m-import.INFO: Attachment file downloaded (id: 22 {"file":"/app/web/app/uploads/2017/02/Casper-van-Eijck-in-actie-0115-007.jpg","url":"https://newdomain/app/uploads/2017/02/Casper-van-Eijck-in-actie-0115-007.jpg","type":"image/jpeg","error":false} []
[2017-02-21 11:42:55] w2m-import.INFO: Successfully imported post {"type":"attachment","origin_id":65328,"local_id":22} []
[2017-02-21 11:42:55] w2m-import.NOTICE: Cannot find remote post for locale en_US {"origin_id":65328,"locale":"en_US","element_id":22} []
[2017-02-21 11:42:55] w2m-import.WARNING: Missing attribute 'date' in XML post node {"action":"w2m_import_parse_post_error"} []
@maartenbusstra
Copy link
Author

Added the import log entries.

@maartenbusstra maartenbusstra changed the title Image imports go into the wrong directory Importing attachments results in faulty file references Feb 21, 2017
@maartenbusstra
Copy link
Author

I set uploads_use_yearmonth_folders to 0, and it seems to work now. This might be a good edge case to consider/test!

@dnaber-de
Copy link
Member

Thanks for reporting the issue. I'll find time within the next days to investigate it in detail.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants