Skip to content

Conversation

@backportbot
Copy link

@backportbot backportbot bot commented May 28, 2025

Backport of PR #52996

mejo- added 2 commits May 28, 2025 11:50
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>
@mejo- mejo- enabled auto-merge May 28, 2025 12:56
@mejo- mejo- merged commit 9a2a2b1 into stable31 May 28, 2025
201 of 205 checks passed
@mejo- mejo- deleted the backport/52996/stable31 branch May 28, 2025 13:00
@nextcloud-bot nextcloud-bot mentioned this pull request Jun 4, 2025
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants