mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
rename cached fileinfo on rename
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
754603a04e
commit
d84f9fa9bb
1 changed files with 9 additions and 0 deletions
|
|
@ -430,6 +430,15 @@ class Node implements \OCP\Files\Node {
|
|||
if (!$this->view->rename($this->path, $targetPath)) {
|
||||
throw new NotPermittedException('Could not move ' . $this->path . ' to ' . $targetPath);
|
||||
}
|
||||
|
||||
$mountPoint = $this->getMountPoint();
|
||||
if ($mountPoint) {
|
||||
// update the cached fileinfo with the new (internal) path
|
||||
/** @var \OC\Files\FileInfo $oldFileInfo */
|
||||
$oldFileInfo = $this->getFileInfo();
|
||||
$this->fileInfo = new \OC\Files\FileInfo($targetPath, $oldFileInfo->getStorage(), $mountPoint->getInternalPath($targetPath), $oldFileInfo->getData(), $mountPoint, $oldFileInfo->getOwner());
|
||||
}
|
||||
|
||||
$targetNode = $this->root->get($targetPath);
|
||||
$this->sendHooks(['postRename'], [$this, $targetNode]);
|
||||
$this->sendHooks(['postWrite'], [$targetNode]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue