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

Fixed SMF Importing: attach bbcode causes post content truncation in thread view (but not in edit view)

#1
A few weeks ago I performed a final SMF import and rolled out XenForo on my public site. There were a number of previous test imports done to identify importing problems to make the transition as smooth as possible. Unfortunately I did not spot this undesired post trimming issue during testing.

In SMF it was possible to insert attachments at specific points of a forum post by using the following bbcode:
Code:
[attach=#]
where # is the post attachment number, e.g. 1 if the post only had 1 attachment. There is no closing [/attach] tag.
I have at least a few instances of a posts (so far they are all from the same 2012 thread) where the imported content is truncated at the first point where the attach bbcode is located in the pre-imported SMF version of the post.

With this said, all of the post attachments display as thumbnails below the truncated XenForo post. Fortunately I have retained a working read-only SMF forum so I will be able to add the missing part of the posts back - at least for the partial posts I am aware of.

EDIT: The post content is all there, but only when opened to edit. So I just needed to delete the attach bbcode for the remainder of the post to show up. It would still be good to see this fixed but the severity isn't as serious as initially thought... phew! :)
 
Last edited:
#3
Thanks @Chris D, that addon is useful for identifying the problem posts (lots of them!! hahaha).

Now that I have a better idea of what's happening I thought I'd clarify the situation in case it helps squash this bug for new SMF imports in the future.
  • Regardless of the number of SMF attach bbcode instances in a single post, XenForo adds just one closing attach tag at the very end of a post (thus hiding part of the post content).
  • If a post with the offending attach bbcode has been quoted in SMF, then XenForo inserts a closing attach bbcode tag at the end of the reply post, followed by a closing quote bbcode tag.
Below is an example of how a post with the SMF attach bbcode might look. Format-wise this is a copy/paste from my forum, but I have changed the names and wording for privacy reasons.

Code:
[quote="username"]
Check out these pics:

[attach=1][attach=2]

Comments welcome.

Regards,
Name
[/quote]

How awesome![/attach][/quote]
So the above post in XenForo will look like this in thread view after importing from SMF (without fixing manually or with the content replacement addon):
username said:
Check out these pics:
The "Comments welcome. Regards, Name" part of the quote and the "How awesome!" part of the reply post are both missing in thread view (until opened in edit view and the attach bbcode removed).

The closing attach and quote tags after the line "How awesome!" were inserted by XenForo and didn't exist in the original SMF post.
 

Chris D

XenForo developer
Staff member
#4
This should be fixed now for the next release.

We actually did no processing of the attachment BB code during the import. I suspect we might not have realised it was possible to embed an attachment like that.

We now handle this better, including properly closing the tag. Thanks for reporting.