Merged
Conversation
Contributor
|
@icewind1991 When copying through dav, fakeRoot is set to the files folder, and that matches the default root, and thanks to that the hook is emitted. Do you thing this is the right fix? Do you think we should give the path of source, target, or both? |
b6c76a3 to
bf67d8f
Compare
Member
Author
|
/backport to stable31 |
Member
Author
|
/backport to stable30 |
e427f00 to
1dd0ec8
Compare
artonge
reviewed
May 27, 2025
Contributor
artonge
left a comment
There was a problem hiding this comment.
Overall, maybe just look into what the handleMove method is doing, as it seems to be doing something very similar.
1dd0ec8 to
f77ae68
Compare
artonge
approved these changes
May 27, 2025
When calling `Files\Node\Node::copy()`, `Files\View::copy()` gets called, but `Files\View::fakeRoot` is empty so the hooks are not emitted if no path is given to `Files\View::shouldEmitHooks()`. This results in node-related events like `NodeCopiedEvent` not being fired when copying files via `Files\Node\Node::copy()`. `Files\View::shouldEmitHooks()` is given a path as parameter in almost all places except when called from the `copy()` function. This commit changes it and passes the copy target path. Fixes: nextcloud/collectives#1756 Signed-off-by: Jonas <jonas@freesources.org>
Running $peerFile->copy() causes a second BeforeNodeCopiedEvent now, which we don't want to handle. Signed-off-by: Jonas <jonas@freesources.org>
f77ae68 to
e5b4ae4
Compare
This was referenced May 28, 2025
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When calling
Files\Node\Node::copy(),Files\View::copy()gets called, butFiles\View::fakeRootis empty so the hooks are not emitted if no path is given toFiles\View::shouldEmitHooks().This results in node-related events like
NodeCopiedEventnot being fired when copying files viaFiles\Node\Node::copy().Files\View::shouldEmitHooks()is given a path as parameter in almost all places except when called from thecopy()function. This commit changes it and passes the copy target path.Fixes: nextcloud/collectives#1756
Checklist