Skip to content

fix(files_versions): Folder should not be hardcoded - #52694

Merged
icewind1991 merged 1 commit into
masterfrom
fixHardcodedVersionsFolder
May 14, 2025
Merged

fix(files_versions): Folder should not be hardcoded#52694
icewind1991 merged 1 commit into
masterfrom
fixHardcodedVersionsFolder

Conversation

@solracsf

@solracsfsolracsf commented May 8, 2025

Copy link
Copy Markdown
Member

Summary

Maybe I'm missing something, but folder should not be hardcoded? 🤔

Fix:

{
"reqId": "anA975K1WAxV3Frui1yJ",
"level": 3,
"time": "2025-05-07T11:55:22+02:00",
"remoteAddr": "5.6.3.4",
"user": "myUser",
"app": "no app in context",
"method": "MOVE",
"url": "/remote.php/dav/files/myUser/userFolder/file.txt",
"message": "Exception thrown: OCP\\Files\\NotFoundException",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36",
"version": "30.0.9.2",
"exception": {
"Exception": "OCP\\Files\\NotFoundException",
"Message": "/admin/files_versions",
"Code": 0,
"Trace": [
{
"file": "/var/www/nextcloud/lib/private/Files/Node/LazyFolder.php",
"line": 141,
"function": "get",
"class": "OC\\Files\\Node\\Root",
"type": "->",
"args": [
"/admin/files_versions"
]
},
{
"file": "/var/www/nextcloud/apps/files_versions/lib/Versions/LegacyVersionsBackend.php",
"line": 374,
"function": "get",
"class": "OC\\Files\\Node\\LazyFolder",
"type": "->",
"args": [
"admin/files_versions"
]
},
{
"file": "/var/www/nextcloud/apps/files_versions/lib/Listener/VersionStorageMoveListener.php",
"line": 129,
"function": "clearVersionsForFile",
"class": "OCA\\Files_Versions\\Versions\\LegacyVersionsBackend",
"type": "->",
"args": [
{
"__class__": "OC\\User\\User"
},
{
"__class__": "OC\\Files\\Node\\File"
},
{
"__class__": "OC\\Files\\Node\\File"
}
]
},
{
"file": "/var/www/nextcloud/apps/files_versions/lib/Listener/VersionStorageMoveListener.php",
"line": 102,
"function": "handleMoveOrCopy",
"class": "OCA\\Files_Versions\\Listener\\VersionStorageMoveListener",
"type": "->",
"args": [
{
"__class__": "OCP\\Files\\Events\\Node\\NodeRenamedEvent"
},
{
"__class__": "OC\\User\\User"
},
{
"__class__": "OC\\Files\\Node\\File"
},
{
"__class__": "OC\\Files\\Node\\File"
},
{
"__class__": "OCA\\Files_Versions\\Versions\\LegacyVersionsBackend"
},
{
"__class__": "OCA\\GroupFolders\\Versions\\VersionsBackend"
}
]
},
{
"file": "/var/www/nextcloud/apps/files_versions/lib/Listener/VersionStorageMoveListener.php",
"line": 74,
"function": "recursivelyHandleMoveOrCopy",
"class": "OCA\\Files_Versions\\Listener\\VersionStorageMoveListener",
"type": "->",
"args": [
{
"__class__": "OCP\\Files\\Events\\Node\\NodeRenamedEvent"
},
{
"__class__": "OC\\User\\User"
},
{
"__class__": "OC\\Files\\Node\\File"
},
{
"__class__": "OC\\Files\\Node\\File"
},
{
"__class__": "OCA\\Files_Versions\\Versions\\LegacyVersionsBackend"
},
{
"__class__": "OCA\\GroupFolders\\Versions\\VersionsBackend"
}
]
},
{
"file": "/var/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php",
"line": 68,
"function": "handle",
"class": "OCA\\Files_Versions\\Listener\\VersionStorageMoveListener",
"type": "->",
"args": [
{
"__class__": "OCP\\Files\\Events\\Node\\NodeRenamedEvent"
}
]
},
{
"file": "/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
"line": 220,
"function": "__invoke",
"class": "OC\\EventDispatcher\\ServiceEventListener",
"type": "->",
"args": [
{
"__class__": "OCP\\Files\\Events\\Node\\NodeRenamedEvent"
},
"OCP\\Files\\Events\\Node\\NodeRenamedEvent",
{
"__class__": "Symfony\\Component\\EventDispatcher\\EventDispatcher"
}
]
},
{
"file": "/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
"line": 56,
"function": "callListeners",
"class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
"type": "->",
"args": [
[
{
"__class__": "Closure"
},
{
"__class__": "Closure"
},
{
"__class__": "Closure"
},
{
"__class__": "Closure"
}
],
"OCP\\Files\\Events\\Node\\NodeRenamedEvent",
{
"__class__": "OCP\\Files\\Events\\Node\\NodeRenamedEvent"
}
]
},
{
"file": "/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php",
"line": 67,
"function": "dispatch",
"class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
"type": "->",
"args": [
{
"__class__": "OCP\\Files\\Events\\Node\\NodeRenamedEvent"
},
"OCP\\Files\\Events\\Node\\NodeRenamedEvent"
]
},
{
"file": "/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php",
"line": 79,
"function": "dispatch",
"class": "OC\\EventDispatcher\\EventDispatcher",
"type": "->",
"args": [
"OCP\\Files\\Events\\Node\\NodeRenamedEvent",
{
"__class__": "OCP\\Files\\Events\\Node\\NodeRenamedEvent"
}
]
},
{
"file": "/var/www/nextcloud/lib/private/Files/Node/HookConnector.php",
"line": 169,
"function": "dispatchTyped",
"class": "OC\\EventDispatcher\\EventDispatcher",
"type": "->",
"args": [
{
"__class__": "OCP\\Files\\Events\\Node\\NodeRenamedEvent"
}
]
},
{
"file": "/var/www/nextcloud/lib/private/legacy/OC_Hook.php",
"line": 82,
"function": "postRename",
"class": "OC\\Files\\Node\\HookConnector",
"type": "->",
"args": [
{
"oldpath": "/userFolder/file.txt",
"newpath": "/groupFolder/folder1/folder2/file.txt"
}
]
},
{
"file": "/var/www/nextcloud/lib/private/Files/View.php",
"line": 833,
"function": "emit",
"class": "OC_Hook",
"type": "::",
"args": [
"OC_Filesystem",
"post_rename",
{
"oldpath": "/userFolder/file.txt",
"newpath": "/groupFolder/folder1/folder2/file.txt"
}
]
},
{
"file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php",
"line": 416,
"function": "rename",
"class": "OC\\Files\\View",
"type": "->",
"args": [
"/userFolder/file.txt",
"/groupFolder/folder1/folder2/file.txt"
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php",
"line": 178,
"function": "moveInto",
"class": "OCA\\DAV\\Connector\\Sabre\\Directory",
"type": "->",
"args": [
"file.txt",
"files/myUser/userFolder/file.txt",
{
"__class__": "OCA\\DAV\\Connector\\Sabre\\File"
}
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
"line": 612,
"function": "move",
"class": "Sabre\\DAV\\Tree",
"type": "->",
"args": [
"files/myUser/userFolder/file.txt",
"files/myUser/groupFolder/folder1/folder2/file.txt"
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
"line": 89,
"function": "httpMove",
"class": "Sabre\\DAV\\CorePlugin",
"type": "->",
"args": [
{
"__class__": "Sabre\\HTTP\\Request"
},
{
"__class__": "Sabre\\HTTP\\Response"
}
]
},
{
"file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 472,
"function": "emit",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": [
"method:MOVE",
[
{
"__class__": "Sabre\\HTTP\\Request"
},
{
"__class__": "Sabre\\HTTP\\Response"
}
]
]
},
{
"file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php",
"line": 49,
"function": "invokeMethod",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": [
{
"__class__": "Sabre\\HTTP\\Request"
},
{
"__class__": "Sabre\\HTTP\\Response"
}
]
},
{
"file": "/var/www/nextcloud/apps/dav/lib/Server.php",
"line": 375,
"function": "start",
"class": "OCA\\DAV\\Connector\\Sabre\\Server",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/apps/dav/appinfo/v2/remote.php",
"line": 19,
"function": "exec",
"class": "OCA\\DAV\\Server",
"type": "->",
"args": []
},
{
"file": "/var/www/nextcloud/remote.php",
"line": 146,
"args": [
"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"
],
"function": "require_once"
}
],
"File": "/var/www/nextcloud/lib/private/Files/Node/Root.php",
"Line": 187,
"CustomMessage": "Exception thrown: OCP\\Files\\NotFoundException"
},
"id": "681cce49d6ba6"
}

Checklist

@solracsf
solracsfforce-pushed the fixHardcodedVersionsFolder branch 2 times, most recently from 0bcb45b to e26beceCompareMay 8, 2025 16:45
@solracsfsolracsf changed the title fix(files_versions): Folder should not be hardcoedfix(files_versions): Folder should not be hardcodedMay 8, 2025
@solracsf
solracsf requested a review from artongeMay 8, 2025 16:51
@solracsf
solracsf marked this pull request as ready for review May 8, 2025 16:56
@solracsf
solracsf requested a review from a team as a code ownerMay 8, 2025 16:56
@solracsf
solracsf requested review from ArtificialOwl and icewind1991 and removed request for a teamMay 8, 2025 16:56
@solracsfsolracsf added this to the Nextcloud 32 milestone May 8, 2025
@solracsf
solracsfforce-pushed the fixHardcodedVersionsFolder branch from e26bece to 49698c8CompareMay 9, 2025 07:25
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
@solracsf
solracsfforce-pushed the fixHardcodedVersionsFolder branch from 49698c8 to 1b549d4CompareMay 9, 2025 07:35

@artongeartonge left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😶

@artonge

Copy link
Copy Markdown
Collaborator

/backport to stable31

@artonge

Copy link
Copy Markdown
Collaborator

/backport to stable30

@artongeartonge added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels May 12, 2025
@solracsf
solracsf enabled auto-merge May 12, 2025 12:32
@artonge
artonge disabled auto-merge May 13, 2025 08:01
@artonge
artonge requested a review from come-ncMay 13, 2025 08:01
@skjnldsvskjnldsv mentioned this pull request Aug 19, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishbugfeature: versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@solracsf@artonge@come-nc@icewind1991@skjnldsv