1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed [attach] bug with importer

Discussion in 'Resolved Bug Reports' started by D.O.A., Oct 6, 2010.

  1. D.O.A.

    D.O.A. Well-Known Member

    Coming across from vb3 latest for testing this out, all went well with 14,763 attachments imported.

    But it seems users who used the 'quick input' thing with attachments in vb3
    [ attach ]123456[ attach ], are linking to images from the attachement folder, not even connected with the post. The attachments that should be there are embeded as normal though, and showing. Some people on my forums post text, then [insert attachment] and post more text [another attachment] etc.

    So if I had 6 images embeded like above I'd end up with twelve in the post, 6 correct ones embed at the bottom as as normal and 6 messed up links like this View attachment 123456
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The attachmentids are not preserved during an import, and those [ attach ] tags obviously reference the ids. I am guessing that is the nature of your problem. It should be possible to write code to update those inlined attachments during the import, but I envision that code being pretty nasty.

    You will probably have to live with it.
     
  3. Rob

    Rob Well-Known Member

    Yeah, it might be a bit *consuming* to find/replace across the entire post table for every attachment id. To be honest the code wouldnt be that bad but it would take ages to run - however, not as long as importing threads/posts.

    This should be an easy ish fix
     
  4. D.O.A.

    D.O.A. Well-Known Member

    I probably could if it didnt involve fixing 12,000 posts. Quite a shame really it's been overlooked. "Time involved" importing means nothing as long as it works. I'm in no hurry.
     
    gordy likes this.
  5. D.O.A.

    D.O.A. Well-Known Member

    I'll use something like http://www.cyberciti.biz/faq/sed-howto-remove-lines-paragraphs for now on my post table sql and remove [ attach ]whatever ID[ /attach ] from all posts, re-import and go from there. Seen as attachments work in a post that was inline, it's just the remnants of the tag in the actual post that need to be removed.
     
  6. D.O.A.

    D.O.A. Well-Known Member

    I ended up using a regular expression (\[ATTACH.*\]) and cleaning them out of the pre- import vbulletin post sql.
     
  7. Jesepi

    Jesepi Well-Known Member

    It could also be an option at the time of running the import to "strip old [ attach ] tags from posts" to clean things up. As it is now, posts have links to un-related attachments in the actual post, with the correct attachments still being shown at the bottom of the post.
     
  8. D.O.A.

    D.O.A. Well-Known Member

    As far as bugs go, this one sucks. Considering my forums are attachment orientated even more so. They really should be stripped out during the import process, it's not good having these unrelated attachment links, like I said earlier I've seen my admin area attachments randomly appear in public threads. As inline attachments are a vbulletin standard as much as a post is it should be reflected in the import process, full stop.
     
    gordy, dmnkhhn and Janmaat like this.
  9. Janmaat

    Janmaat Active Member

    +1 from me!
     
  10. dmnkhhn

    dmnkhhn Active Member

    I didn't know inline attachments are not imported/converted correctly.

    This means a new entry to my list of things that stop us from converting. :(
     
  11. gordy

    gordy Well-Known Member

    Same here, major setback. Many of my reviewers posts are text,image,text,image,etc now the thumbnails are all jumbled at the bottom of each post. The attachments aren't even available when I go to edit the post, :mad:
     
  12. Digital Doctor

    Digital Doctor Well-Known Member

    This is unfortunate.
    Hopefully the Importer is improved to handle inline attachments.
     
  13. Kier

    Kier XenForo Developer Staff Member

    The next version of the importer has this problem resolved.
     
  14. AndreaMarucci

    AndreaMarucci Well-Known Member

    I know that this question os maybe offtopic here but since this problem is also in the V4 importer, when do you plan to release an official importer for V4?
     
  15. gordy

    gordy Well-Known Member

    Hooray! \o/
     
  16. Paul M

    Paul M Well-Known Member

    How exactly ?
     
  17. Kier

    Kier XenForo Developer Staff Member

    There's a new ability to update the post table during XenForo_Model_Import::importPostAttachment().
     
  18. Paul M

    Paul M Well-Known Member

    Interesting.

    I'll be looking to see how that works.

    Thanks.
     
  19. gordy

    gordy Well-Known Member

    And it worked excellently (y)
     
    Kier likes this.

Share This Page