Skip to content

Commit

Permalink
Merge pull request #4295 from owncloud/fix/invalid_copy_into_descenda…
Browse files Browse the repository at this point in the history
…nt_in_different_spaces

[BUG] Invalid copy into descendant in different spaces
  • Loading branch information
Aitorbp committed Feb 5, 2024
2 parents f30662e + 03a93f4 commit 800d5c2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ ownCloud admins and users.
* Bugfix - Conflict in copy with files without extension: [#4222](https://github.com/owncloud/android/issues/4222)
* Bugfix - Add "scope" parameter to /token endpoint HTTP requests: [#4260](https://github.com/owncloud/android/pull/4260)
* Bugfix - Fix in the handling of the base URL: [#4279](https://github.com/owncloud/android/issues/4279)
* Bugfix - Copy folder into descendant in different spaces: [#4293](https://github.com/owncloud/android/issues/4293)
* Change - Android library as a module instead of submodule: [#3962](https://github.com/owncloud/android/issues/3962)
* Enhancement - Koin DSL: [#3966](https://github.com/owncloud/android/pull/3966)
* Enhancement - Unit tests for datasources classes - Part 1 & Fixes: [#4063](https://github.com/owncloud/android/issues/4063)
Expand Down Expand Up @@ -122,6 +123,14 @@ ownCloud admins and users.
https://github.com/owncloud/android/issues/4279
https://github.com/owncloud/android/pull/4287

* Bugfix - Copy folder into descendant in different spaces: [#4293](https://github.com/owncloud/android/issues/4293)

Copying a folder into another folder with the same name in a different space now
works correctly.

https://github.com/owncloud/android/issues/4293
https://github.com/owncloud/android/pull/4295

* Change - Android library as a module instead of submodule: [#3962](https://github.com/owncloud/android/issues/3962)

Android library, containing all networking stuff, is now the 5th module in the
Expand Down
6 changes: 6 additions & 0 deletions changelog/unreleased/4295
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Copy folder into descendant in different spaces

Copying a folder into another folder with the same name in a different space now works correctly.

https://github.com/owncloud/android/issues/4293
https://github.com/owncloud/android/pull/4295
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class CopyFileUseCase(
fun validateOrThrowException(listOfFilesToCopy: List<OCFile>, targetFolder: OCFile) {
require(listOfFilesToCopy.isNotEmpty())

if (listOfFilesToCopy.any { targetFolder.remotePath.startsWith(it.remotePath) }) {
if (listOfFilesToCopy.any { targetFolder.remotePath.startsWith(it.remotePath) && targetFolder.spaceId == it.spaceId }) {
throw CopyIntoDescendantException()
}
}
Expand Down

0 comments on commit 800d5c2

Please sign in to comment.