Fixed Re-Uploading Add-on ZIP does not fix corrupted file(s)

Kirby

Well-known member
Affected version
2.1.2
Steps to reproduce
  1. Install some Add-on
  2. Intentionally modify one if its PHP files to simulate a corruption
  3. Perform a file health check to make sure that the file does show up as modified
  4. Re-Upload the Add-on ZIP file through Add-ons > Install/upgrade from archive
  5. Perform the health check again

Expected Result
The file does not show up as modified any longer

Actual Result
The file still shows up as modified and as not been updated

Seeing the comments this seems intentional / working as designed though I think this isn't what a user would expect:
If a file triggers a health check error and the user performs a classical reupload of the file(s) (via FTP, etc.) the file would get overwwritten and the heatl check error disappears.

IMHO the one-click upload should behave the same way.
 
Last edited:
This is actually intentional, though I'm not going to close the bug just yet.

We decide which files to copy, if any, by comparing the original hashes file on the file system with the new hashes file in the archive.

So, by design, we only copy files we think have changed in order to speed up the process, which in turn reduces the chance of further files becoming corrupted, and finally prevent any user edited files from being overwritten.

I appreciate this specific scenario does cause a bit of a stalemate though so we should consider another approach (which I think I have one in mind, but bear with us).
 
Although we will still continue to do the hash check to determine which files (if any) to copy by default, from XF 2.1.3 we have now added a checkbox on the Install from archive confirmation page to override that behaviour and force all files to be overwritten:

1562270183231.webp

You can only check the checkbox if it is an upgrade or a rebuild. If it is checked, the hashes check is skipped and the files are overwritten.
 
Thank you for reporting this issue. It has now been resolved and we are aiming to include it in a future XF release (2.1.3).

Change log:
Add a checkbox so that add-ons rebuilt/upgraded from archive can opt to have all their files overwritten rather than only changed files.
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
You can only check the checkbox if it is an upgrade or a rebuild. If it is checked, the hashes check is skipped and the files are overwritten.

How does this behave if you're installing an add-on that already has the files uploaded (for example, if you uninstalled a previous version of it)? Will it overwrite all files regardless?
 
Back
Top Bottom