[solved] Solve the trashbin issue integrating a patch: doesn't work

Hello,
After having met a bug with the trashbin (https://github.com/nextcloud/server/issues/22475 - Trash get fully emptied when Cron runs (v18.0.8 and v19.0.2)) I try to apply the patch in https://github.com/nextcloud/server/pull/22528
I modified apps/files_trashbin/lib/Trashbin.php with the new version, but it doesn’t work: the “deleted files” in the web UI of nextcloud disappears (I try to reboot: no change).
If I put back the old version of Trashbin.php, it works again.
What am I doing wrong?
Thanks!

I also tried to replace the whole folder by https://github.com/nextcloud/server/tree/master/apps/files_trashbin (setting the right access right and ownerships to www-data)
But then the web UI just remains blank and I have this in the log:

  • Error PHP Interface ‘OCP\AppFramework\Bootstrap\IBootstrap’ not found at /var/www/html/nextcloud/apps/files_trashbin/lib/AppInfo/Application.php#42
  • Error jsresourceloader Could not find resource js/config.js to load

That was a bit too much, the app is generally incompatible with older releases, the fix has to be applied with care.

The fix was backported to 18 here: [stable18] Change free space calculation by backportbot-nextcloud[bot] · Pull Request #22554 · nextcloud/server · GitHub. You can download a patch from https://patch-diff.githubusercontent.com/raw/nextcloud/server/pull/22554.patch. This should apply fine on your Nextcloud 18 installation (once your undo the app replacement).

1 Like

You are downloading the master file, while your server is v18 or v19.

Download the correct file from the correct branch please:

3 more things:

  • Don’t EVER apply upgrades without a full backup
  • Don’t EVER apply upgrades without testing it on a STAGING server
  • At very least, if your system is critical, apply upgrades delayed and after looking up GIT/Forum for critical issues reported.

Thanks for your feedback, it worked :slight_smile: I used the correct version for NC19 in https://github.com/nextcloud/server/blob/82239d8e3e0cb7b8992f3411320e362770cb26a2/apps/files_trashbin/lib/Trashbin.php

Issue is solved, thanks :slight_smile:

of course, but why tf are new features introduced into a minor release?

1 Like