Bug on "Replace File" feature on Event and Project pages

Summary

There is a bug in Files section inside Event page.

Replace Existing File? functionality doesn’t replace the already uploaded file.
You have to delete and upload it again.

Steps to reproduce

  • Prepare files a.pdf and b.pdf with different content
  • Open an event or a project
  • In the files section, upload a.pdf with title Test
  • Download the uploaded file -> download_1.pdf
  • Upload b.pdf with title Test and select the option: Replace Test
  • Download the uploaded file -> download_2.pdf

Expected Result

The two different downloaded files are not equals. download_1.pdf should be equal to a.pdf and download_2.pdfshould be equals to b.pdf.

Actual Result

download_1.pdf has the same content of a.pdf, but download_1.pdf has a.pdf's content too.

Hey Matteo!

Interesting. For me, it is actually “replacing” the existing file, but it’s keeping the old file name. So if I first upload “a.txt”, with the title “Staff Schedule”, and then I upload “b.xlsx”, with the title “New Staff Schedule”, and select “Replace Staff Schedule”, then I get a single file, with the title “New Staff Schedule”, pointing to a file with filename “a.txt”, but with the contents of “b.xlsx”. That obviously is a problem, since changing the filename is likely to be confusing, and changing the extension is downright broken.

Is that what you’re seeing as well? If so, I believe I can fix this by just using the filename for the new file, instead of the old one - I just want to make sure that you aren’t seeing some other different behavior.

Thanks!

Hi Dan,

I got more time to expand the scenario in the first question. Let me know if it’s clear and if you can repeat the process.

Cheers,
M.

I think I understand. I’ve just deployed a fix, please let me know if it still isn’t working as you expect

Nope. It’s going to 500

Page unavailable

Sorry, but the requested page is unavailable due to a server hiccup.

This is probably due to a bug that we don’t know about. Please let us know so we can fix it.

Oh, you’re on the Project files page now. Okay, I see the issue and I’ve fixed that one as well.

Ops, I thought it was the same feature and code for projects and events.

Btw, I confirm that now it works on both.