Attached Images Not Displaying Correct

Disciple of Nagash

Active member
Hi,

I'm hoping you can help with the following issue, not sure if a bug or something gone wrong previously.

Overview
  • Live forum on 1.4.10
  • Currently upgrading to latest version of XF2 (being carried out by mattwservices)
  • I've been absent from my forum for quite a few years, so I don't know when this issue actually occurred
  • This has happened to a number of different posts (so I'm hoping there is a fix that would run through and fix them all)
  • This is present on both the live board, and the test board I am currently evaluating XF2 on
Description
Certain posts with images that were attached previously do not display the image correctly:
Attachment Error 1.webp

If I click on one of the image links (such as DSCN0985.JPG in the above picture), it loads and displays ok in a separate tab :
Attachment Error 2.webp

If I click to edit the post, it doesn't bring up the normal image options of inserting the image into the post, which makes me think that XF does not see them as image files:
Attachment Error 3.webp

Images in other posts do display ok:
Attachment Error 4.webp

Please let me know if you need any more information.

Cheers
 
Was the forum ever on another forum software, before XF?

The reason I ask is that we have not ever had a BB code by the name of [attachment] we actually use [attach].

With that in mind, my current theory is that these inconsistencies have come in via an import from that software.

You could consider using the "Post content find & replace" add-on to replace those incorrect BB codes, though you'll need to check whether the ID within the BB code actually is correct, for example in case the attachments were imported with different IDs. If they were imported with different IDs, you'll probably actually be looking to just remove those BB codes entirely.

The attachment files which don't have a thumbnail will likely just need the thumbnails rebuilding, which you can do under Tools > Rebuild caches in the Admin CP.
 
Thanks for the reply.

Yes the forum was on MyBB beforehand, although I didn't realise there was this issue when we moved over.

I have just run the Rebuild Attachment Thumbnails tool, and whilst it ran and says successfully completed (although only encountered a 503 error which cleared on refresh), the attachments have not changed. The post still has the pictures attached without thumbnails, and still doesn't have the option to insert into the post etc.

Anything else I can try?
 
More info; I tried installing the addon and it's not picking these up as images, either in the bulk resize option or the different addon which allows you to resize in the post.

Is there some data that records the type of attachment for a post?
 
If you can locate those attachments in the xf_attachment_data table then check to see if they have any width/height dimensions recorded.
 
@AndyB thanks for the link to resource. Reading through the documentation, it states that it only finds the posts with the problem attachments, but it doesn't appear to fix them?

Q: The results show I have some posts with resources missing, what should I do?
A: You have several options, delete the thread, delete the post, edit the post and delete the attachment. You have to decide which is the best option for you in each case.


Is there an option for it to correctly update the database values?
 
Back
Top Bottom