Jump to content
  • Status: Fixed

Fresh install. Only IPS apps.

Category:

image.png

Index:

image.png

image.png

We really need this fixed. It's been there since Beta 5.

User Feedback

Recommended Comments

Matt

Management
  • Management

I've finally been able to reproduce it, and it's only reproducible when Sync Topics is enabled.

Try this:

screenshot-fix.zip

Adriano Faria

Clients

It worked in localhost but not 100% on my site:

image.png

A couple of files worked; a couple of files didn't work.

Matt

Management
  • Management
18 hours ago, Adriano Faria said:

It worked in localhost but not 100% on my site:

image.png

A couple of files worked; a couple of files didn't work.

I the thumb was already gone or assigned to attachments too, it won't fix that. Re-uploading the primary image will then fix it for future edits.

Adriano Faria

Clients

Nope, the thumb was there. I had to upload a new version of a file after your fix and it happened. Main screenshot is gone from Downloads (file, category, index, widgets) and support topic.

I will record the screen uploading a new version in 30 minutes.

Adriano Faria

Clients
36 minutes ago, Matt said:

I the thumb was already gone or assigned to attachments too, it won't fix that. Re-uploading the primary image will then fix it for future edits.

32 minutes ago, Adriano Faria said:

I will record the screen uploading a new version in 30 minutes.

Matt

Management
  • Management

It's unclear from that video, but here's what the bug is doing.

You upload a screenshot, and thumbnails are generated
SyncTopic runs, and it adds the primary screenshot path/filename to the core_attachments table
At this point, the primary screenshot path/filename is now in the core_attachments table and also the downloads table.
You do something (edit, add a new version)
SyncTopic runs, and it gets the image from core_attachments and deletes the file, which deletes the thumbnail too, then it gets the primary screenshot and recreates the image but not the thumbnail itself.
Now the thumbnail path/filename is still in the downloads table, but the physical file on disk has been deleted, so you get a missing image.

This means that uploading the files will fix all new downloads files created, but will not fix existing download files because the attachment data will be already be stored in two tables.

I might write a little script to fix the database.

Adriano Faria

Clients
12 minutes ago, Matt said:

It's unclear from that video

The main screenshot is missing if I upload a new version to any file.

13 minutes ago, Matt said:

This means that uploading the files will fix all new downloads files created, but will not fix existing download files because the attachment data will be already be stored in two tables.

I might write a little script to fix the database.

I hope you do that. It's not friendly at all to have to re-upload screenshots from all 359 files in my installation every time I upload a new version or edit a file.

Thank you.

EliasM

Clients
26 minutes ago, Matt said:

It's unclear from that video, but here's what the bug is doing.

You upload a screenshot, and thumbnails are generated
SyncTopic runs, and it adds the primary screenshot path/filename to the core_attachments table
At this point, the primary screenshot path/filename is now in the core_attachments table and also the downloads table.
You do something (edit, add a new version)
SyncTopic runs, and it gets the image from core_attachments and deletes the file, which deletes the thumbnail too, then it gets the primary screenshot and recreates the image but not the thumbnail itself.
Now the thumbnail path/filename is still in the downloads table, but the physical file on disk has been deleted, so you get a missing image.

This means that uploading the files will fix all new downloads files created, but will not fix existing download files because the attachment data will be already be stored in two tables.

I might write a little script to fix the database.

Since this was not present in version 4, this is a bug that needs to be fixed

Matt

Management
  • Management

It is, and I've just released a patch but the issue is that the data is already incorrect in the core_attachments table, so the "bug" will manifest until you manually update the primary screenshot, I am going to write a script to fix this.

Matt

Management
  • Management

Changed Status to Fixed

Matt

Management
  • Management

Is anyone willing to give me FTP access to a site affected by this bug? Update your client area with the details and PM me when you've done that. I have a script ready but I'd like to test it a bit before releasing it.

Adriano Faria

Clients
35 minutes ago, Matt said:

Is anyone willing to give me FTP access to a site affected by this bug? Update your client area with the details and PM me when you've done that. I have a script ready but I'd like to test it a bit before releasing it.

I just did it.

Please test in this file.

Matt

Management
  • Management

Great thank you! I'll run it without updating anything to see what kind of data it finds first.

Matt

Management
  • Management

Ok, I think you're good now. It didn't find any affected records. I presume you uploaded the patch zip, and then uploaded the primary screenshots again on those sites where they were missing?

Adriano Faria

Clients
12 minutes ago, Matt said:

I presume you uploaded the patch zip

Yes.

12 minutes ago, Matt said:

and then uploaded the primary screenshots again on those sites where they were missing?

Before the patch.

Can I make a test now?

Matt

Management
  • Management

I have edited that file a few times and the screenshots persist. I added a new version (but didn't change the version number or details) and the screenshots persist.

Just now, Adriano Faria said:

Yes.

Before the patch.

Can I make a test now?

Please do, let me know how it goes.

Adriano Faria

Clients
13 minutes ago, Matt said:

Please do, let me know how it goes.

I edited the file. No problem. Then I uploaded a new version without change details and:

image.png

I won't upload a new screenshot so you can take a look if you want.

Matt

Management
  • Management

Thanks, looking now.

Matt

Management
  • Management

Ok, should all be fixed.

Adriano Faria

Clients

Unfortunately, no. Now no screenshots appear in the file.

image.png

I have no problem when editing the file. The problem now is when I upload a new version.

Matt

Management
  • Management

I just did this and it was fine. 😢

Talk me through what you did.

Adriano Faria

Clients
11 minutes ago, Matt said:

Talk me through what you did.

Edited the file. No problem. Uploaded a new version without changing details. Screenshots disappeared.

That's all.

Matt

Management
  • Management

I literally just did this on that exact same file and it was fine. I'll try again.

Did you restore view.php from the zip? The change I just made wasn't there. Re-added the fix.

Adriano Faria

Clients

Feel free to disable 3rd-party stuff, although it makes no difference now as apps won't change the behavior... and log in to my account.

Matt

Management
  • Management

Ok, try now.

I deleted all screenshots

Re-added all screenshots

Saved

Used Upload new version (left all the same)

Saved

Images still showing.