Merge pull request #44279 from nextcloud/sort-submount-view

fix: ensure nested mount points are handled in the correct order
jr/enh/updates/options-buttons-web-ui
Robin Appelman 2024-03-18 18:58:50 +07:00 committed by GitHub
commit 79e9cdc467
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

@ -1481,6 +1481,13 @@ class View {
//add a folder for any mountpoint in this directory and add the sizes of other mountpoints to the folders
$mounts = Filesystem::getMountManager()->findIn($path);
// make sure nested mounts are sorted after their parent mounts
// otherwise doesn't propagate the etag across storage boundaries correctly
usort($mounts, function (IMountPoint $a, IMountPoint $b) {
return $a->getMountPoint() <=> $b->getMountPoint();
});
$dirLength = strlen($path);
foreach ($mounts as $mount) {
$mountPoint = $mount->getMountPoint();