XF 2.1 Links to posts in the same forum are unfurling the wrong post - the first on the page

Stuart Wright

Well-known member
We have a problem where links to posts within our forum are unfurling to show show the first post on the page instead of the correct post.
They do, however, link to the correct post.

If I change the admin setting for the number of messages on the page (from the usual 25 to 26), the existing messages continue to show the original (wrong) post until I post a reply containing a link to a post in the same thread, at which time the existing unfurls change to show the new first post on the page (which is also the wrong post).

The same incorrect preview happens when using the unfurl test tool at /admin.php?tools/test-url-unfurling.

I've looked through our (many) addons and disabled the only one which I think could cause this and the problem still exists.
We use Cloudflare. I tested with that in development mode to bypass cache, but the problem still exists.
Any ideas on how to fix this, please?
Thanks
 
Last edited:
  • Like
Reactions: arn

Mike

XenForo developer
Staff member
This isn't really unexpected. Jumping to a post is really jumping to a particular location within a page. Unfurling works on a page basis, so what it's pulling in is what we report and that's based on the first post.
 

Stuart Wright

Well-known member
Thanks for the reply, Mike. So it's normal behaviour. That's disappointing because from a user's perspective, it's completely wrong information. A user would obviously expect to see the specific information relating to the post they are linking to.
I'll add it as a suggestion, though I feel it's actually closer to a bug.
Thanks.
 

marquisite

Well-known member
@Stuart Wright there is a workaround that I occasionally use on my own site but it requires 1) linking to a post using a /posts/[post-id]/show URL and 2) editing the post template to include a meta description (post snippet) and more appropriate page title. The title format I use is "Post #[post.position] in [thread.title]". Without the template edit, the unfurled URL information is very generic. For example, your post:

With the template edit, it should be something more like what's shown in this attachment:
xenforo-2-1-single-post-unfurled-example-with-template-edit-workaround.gif

The problem with this workaround is that even if the post URL is used, when someone does click on the unfurled URL, they won't see any other posts in the thread.
 
Top