Skip to content

Conversation

@susnux
Copy link
Contributor

@susnux susnux commented Mar 20, 2025

Summary

getPathForNode can fail with null for various reasons (e.g. no owner), in this cases we need to just skip the event handling.

Checklist

@susnux susnux added this to the Nextcloud 32 milestone Mar 20, 2025
@susnux susnux requested a review from a team as a code owner March 20, 2025 17:46
@susnux susnux requested review from ArtificialOwl, come-nc and nfebe and removed request for a team March 20, 2025 17:46
@susnux susnux force-pushed the fix/files-versions-listeners branch from 80dae1b to bae9db5 Compare April 7, 2025 12:58
@susnux susnux requested a review from come-nc April 7, 2025 12:58
@AndyScherzinger AndyScherzinger force-pushed the fix/files-versions-listeners branch from 8ce3d91 to b710a81 Compare April 23, 2025 22:12
@AndyScherzinger AndyScherzinger force-pushed the fix/files-versions-listeners branch 2 times, most recently from 3b1718c to 198261c Compare April 27, 2025 21:03
`getPathForNode` can fail with null for various reasons (e.g. no owner),
in this cases we need to just skip the event handling.

Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux force-pushed the fix/files-versions-listeners branch from 198261c to 8ca23f2 Compare April 27, 2025 21:52
@AndyScherzinger AndyScherzinger merged commit e2a54af into master Apr 27, 2025
191 of 196 checks passed
@AndyScherzinger AndyScherzinger deleted the fix/files-versions-listeners branch April 27, 2025 22:26
@edward-ly
Copy link
Contributor

Shouldn't this PR be backported to stable30 and stable31, or was there a reason for not doing so?

@edward-ly
Copy link
Contributor

/backport to stable31

@edward-ly
Copy link
Contributor

/backport to stable30

@susnux
Copy link
Contributor Author

susnux commented Jun 16, 2025

Shouldn't this PR be backported to stable30 and stable31, or was there a reason for not doing so?

Because waiting to also include #53276

Comment on lines +342 to +345
$user = $this->userSession->getUser()?->getUID();
if ($user === null) {
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, this completely disables files_version event listeners when files are moved with occ, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See old code: It needs a user anyways \OC_User::getUser() for the view otherwise it fails

@nextcloud-bot nextcloud-bot mentioned this pull request Aug 19, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
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.

7 participants