mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 09:13:19 -04:00
Merge pull request #41365 from nextcloud/bugfix/noid/fix-emitted-events
fix(events): Make sure all `\OCP\Files::…` events are emitted with th…
This commit is contained in:
commit
397c96967a
1 changed files with 8 additions and 1 deletions
|
|
@ -132,7 +132,14 @@ class Node implements INode {
|
|||
if (method_exists($this->root, 'emit')) {
|
||||
$this->root->emit('\OC\Files', $hook, $args);
|
||||
}
|
||||
$dispatcher->dispatch('\OCP\Files::' . $hook, new GenericEvent($args));
|
||||
|
||||
if (in_array($hook, ['preWrite', 'postWrite', 'preCreate', 'postCreate', 'preTouch', 'postTouch', 'preDelete', 'postDelete'], true)) {
|
||||
$event = new GenericEvent($args[0]);
|
||||
} else {
|
||||
$event = new GenericEvent($args);
|
||||
}
|
||||
|
||||
$dispatcher->dispatch('\OCP\Files::' . $hook, $event);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue