WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Importer
[resolved] Importer ignores attachment_url from WXR (24 posts)

  1. barbutti47
    Member
    Posted 3 years ago #

    Hi,

    I started noticing since the release of version 0.3 of the WordPress Importer that the parser is ignoring the value set in the <wp:attachment_url> of the WXR XML when it tries to download file attachments.

    I was able to verify this by looking into the value of the $import_data variable inside the WP_Import::import_start method. Since the parser is ignoring the wp:attachment_url value, the importer uses the value of <guid> for the URL download -- which most of the times (at least to me) isn't correct.

    Anyone experiencing the same problem?

    Thanks.

  2. mmjaeger
    Member
    Posted 3 years ago #

    while 0.2 imported all my post attachments - 0.3 doesn't - always getting an error - is the older version still available somewhere?

  3. Jon Cave
    WordPress Dev
    Plugin Author

    Posted 3 years ago #

    Confirmed. Thanks for reporting, will fix shortly.

    The old version is available from the other versions download page.

  4. Jon Cave
    WordPress Dev
    Plugin Author

    Posted 3 years ago #

    In about 10 minutes you can try the development version which has had a fix applied. It will show up as version 0.4-alpha1 in your plugins page and it is available from the other versions download page (or use this direct link to the zip file).

    If you are able to test it out to confirm it works I would appreciate it.

    Thanks again for reporting so quickly!

  5. mmjaeger
    Member
    Posted 3 years ago #

    the updated plugin seems to do something - however, I don't see any progress in the browser - no messages, nothing...

    I'll let you know whether it imported the attachment when its done - if it gets there - 0.2 worked by the way

  6. mmjaeger
    Member
    Posted 3 years ago #

    the process finished and attachment got imported - however, what's confusing is that e.g. an image that was in the following folder in source installation: ..uploads/2003/05/image.jpg end up in the new location at .../uploads/2010/09/image.jpg

    any ideas?

  7. Jon Cave
    WordPress Dev
    Plugin Author

    Posted 3 years ago #

    That's strange and it's not happening for me (e.g. getting uploads in 2010/08 and 2011/01 for the latest theme test data).

    The file should be saved using the post date specified for a particular attachment in the export file. Take a look at the XML and search for one of the attachments that's in the wrong folder and check the <wp:post_date> tag.

  8. mmjaeger
    Member
    Posted 3 years ago #

    I got this for instance:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    the entry was posted on July 30, 2003 and the picture ends up in uploads/2010/09 ??

  9. mmjaeger
    Member
    Posted 3 years ago #

    any progress on this issue: he process finished and attachment got imported - however, what's confusing is that e.g. an image that was in the following folder in source installation: ..uploads/2003/05/image.jpg end up in the new location at .../uploads/2010/09/image.jpg

    any ideas?

    The pictures still end up at the wrong location?

    what the latest version of this plugin?

  10. Jon Cave
    WordPress Dev
    Plugin Author

    Posted 3 years ago #

    any progress on this issue: he process finished and attachment got imported - however, what's confusing is that e.g. an image that was in the following folder in source installation: ..uploads/2003/05/image.jpg end up in the new location at .../uploads/2010/09/image.jpg

    Still cannot reproduce this as stated above.

    any ideas?

    Have you tried disabling all other plugins before importing? It's possible, though unlikely, that another plugin could be filtering the upload path to cause a problem.

    what the latest version of this plugin?

    The current stable version is 0.3. In trunk is 0.4-alpha2 which will be released soon.

    Could you repost some data from your import xml file (use a pastebin as suggested by the mod who had to remove whatever you pasted last time) or you can email me a file (wp AT lionsgoroar.co.uk).

  11. Lampei
    Member
    Posted 3 years ago #

    Is there a way to get debug output to the screen when trying to do an import? I've uploaded the alpha2 version and enabled the plugin. Then I choose the file and click "Upload file and import" and get taken to a screen that just shows "Import WordPress" as the title, and blank below that. If I could see what has failed I may be able to check into what is happening.
    Thanks.

  12. Lampei
    Member
    Posted 3 years ago #

    BTW, I tried v0.2 and that got further along in the import process, but still failed. I tried removing certain posts and entries, but figured I'd give 0.4 a try first (but still no luck)

  13. Lampei
    Member
    Posted 3 years ago #

    Also tried setting the "importdebug" to true and that doesn't seem to be outputting anything either.

  14. Jon Cave
    WordPress Dev
    Plugin Author

    Posted 3 years ago #

    @Lampei:

    Firstly could you please open a new forum thread for this problem as this current thread is now tracking three separate problems.

    Secondly, try adding WP_DEBUG to your wp-config.php file as well as enabling IMPORT_DEBUG in the plugin file:

    define('WP_DEBUG',true);

    Also checkout sivel's page on the 'WordPress White Screen of Death'

    Also include full details of your setup in the new thread.

    Thanks.

  15. Sunny_Balanga
    Member
    Posted 3 years ago #

    I too am having problems with importing the attachments.
    I have tried the plugin versions 0.2, 0.3 and 0.4-alpha1.
    The posts are restored but NO images. Help?

  16. Jon Cave
    WordPress Dev
    Plugin Author

    Posted 3 years ago #

    I too am having problems with importing the attachments.
    I have tried the plugin versions 0.2, 0.3 and 0.4-alpha1.
    The posts are restored but NO images. Help?

    Did you check the box labelled "Download and import file attachments" on the second screen (just after you upload the import file)? Please could you also open a new thread if this wasn't the problem instead of continuing here.

  17. Sunny_Balanga
    Member
    Posted 3 years ago #

    Yes I checked it and OK I'll open a new thread.. Thanks..

  18. Jon Cave
    WordPress Dev
    Plugin Author

    Posted 3 years ago #

    0.4 is released fixing the original problem described and also mmjaeger's problem with attachments in the wrong location. Marking as resolved.

  19. barbutti47
    Member
    Posted 3 years ago #

    I'm sorry, Jon but this doesn't seem to be fixed.
    After a few tests here, it seems to be downloading only one attachment file from the XML, no matter how many are declared in it. It's not giving out any errors either, which I guess makes things even more confusing.

    Any ideas?

  20. Jon Cave
    WordPress Dev
    Plugin Author

    Posted 3 years ago #

    That's strange. Multiple attachments are fine for me.

    Are you only seeing one item in the Media admin section? Did the import complete properly, i.e. did you see the "All done. Have fun" message at the end?

    Could you provide me with an example export file to test? Email wp AT lionsgoroar.co.uk if possible.

  21. barbutti47
    Member
    Posted 3 years ago #

    Hey Jon,

    I was able to track down the problem, and it's not exactly the importer's fault. The file attachments on my XML had empty <wp:post_id></wp:post_id>s, and this is a problem with the new version of the importer (wasn't before with the older versions).

    Line 526 of the importer has this code that's causing the problem with my XML:

    if ( isset( $this->processed_posts[$post['post_id']] ) )

    Maybe the importer could check if the post_id isn't empty before seeing if it's been processed before?

    I understand this can bring problems, and that my XML should probably have the post ids all along. But who knows… =)

    Thank you for the help!

  22. Jon Cave
    WordPress Dev
    Plugin Author

    Posted 3 years ago #

    Nice job tracking that down.

    I will include the fix for you in the next version -- may not be a while for full release but you will have the fix locally -- as it makes sense, even if it's a very unusual problem. It will probably be in the development version tomorrow.

    Thank you for the help!

    No problem. Glad I was able to :)

  23. solarkritik
    Member
    Posted 3 years ago #

    Version 0.4 in WordPress 3.1.

    The import of all tags failed !!

  24. Jon Cave
    WordPress Dev
    Plugin Author

    Posted 3 years ago #

    Version 0.4 in WordPress 3.1.

    The import of all tags failed !!

    Firstly, could you please open a new thread. This is unrelated to this thread which is already long enough.

    On the new thread could you please give more details about the options you used when exporting. More details about how the tags have failed; are tags present in Posts > Post Tags? are tags just not attached to posts?

    An example export file would be most useful for debugging any problem. Email wp AT lionsgoroar.co.uk if you do not want to upload it publicly.

    Finally, I'm having no problems with tags myself :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic