mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
fix(node): emit hooks on Node::copy()
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>
This commit is contained in:
parent
c003cbb002
commit
10034c4d15
1 changed files with 2 additions and 2 deletions
|
|
@ -935,7 +935,7 @@ class View {
|
|||
|
||||
try {
|
||||
$exists = $this->file_exists($target);
|
||||
if ($this->shouldEmitHooks()) {
|
||||
if ($this->shouldEmitHooks($target)) {
|
||||
\OC_Hook::emit(
|
||||
Filesystem::CLASSNAME,
|
||||
Filesystem::signal_copy,
|
||||
|
|
@ -975,7 +975,7 @@ class View {
|
|||
$this->changeLock($target, ILockingProvider::LOCK_SHARED);
|
||||
$lockTypePath2 = ILockingProvider::LOCK_SHARED;
|
||||
|
||||
if ($this->shouldEmitHooks() && $result !== false) {
|
||||
if ($this->shouldEmitHooks($target) && $result !== false) {
|
||||
\OC_Hook::emit(
|
||||
Filesystem::CLASSNAME,
|
||||
Filesystem::signal_post_copy,
|
||||
|
|
|
|||
Loading…
Reference in a new issue