Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable30] fix: Handle copy of folders containing live photos #49650

Merged
merged 5 commits into from
Dec 12, 2024

Conversation

backportbot[bot]
Copy link

@backportbot backportbot bot commented Dec 4, 2024

Backport of #49293

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot backportbot bot added this to the Nextcloud 30.0.3 milestone Dec 4, 2024
@artonge artonge changed the base branch from stable30 to backport/48563/stable30 December 4, 2024 17:22
@artonge artonge force-pushed the backport/48563/stable30 branch from 62830a7 to be7b6a7 Compare December 5, 2024 09:35
@artonge artonge force-pushed the backport/49293/stable30 branch 2 times, most recently from 79ebb1b to 05be967 Compare December 5, 2024 09:39
We need to recursively look for live photos in the folder,
and then handle them as usual.

Signed-off-by: Louis Chemineau <[email protected]>
@artonge artonge force-pushed the backport/49293/stable30 branch from f5565be to f2d2dc1 Compare December 5, 2024 09:48
@artonge artonge force-pushed the backport/49293/stable30 branch from f2d2dc1 to 3497725 Compare December 5, 2024 09:48
@artonge artonge marked this pull request as ready for review December 5, 2024 09:48
@artonge
Copy link
Contributor

artonge commented Dec 5, 2024

return $this->fileView->copy($sourcePath, $destinationPath);
$copyOkay = $this->fileView->copy($sourcePath, $destinationPath);

if (!$copyOkay) {

Check notice

Code scanning / Psalm

RiskyTruthyFalsyComparison Note

Operand of type bool|mixed contains type mixed, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead.
if ($peerFileId === null) {
return;
}
$peerFile = $this->userFolder->getFirstNodeById($peerFileId);

Check notice

Code scanning / Psalm

PossiblyNullReference Note

Cannot call method getFirstNodeById on possibly null value
if ($event instanceof BeforeNodeCopiedEvent) {
$this->runMoveOrCopyChecks($sourceNode, $targetNode, $peerFile);
} elseif ($event instanceof NodeCopiedEvent) {
$this->handleCopy($sourceNode, $targetNode, $peerFile);

Check notice

Code scanning / Psalm

ArgumentTypeCoercion Note

Argument 3 of OCA\Files\Listener\SyncLivePhotosListener::handleCopy expects OCP\Files\File, but parent type OCP\Files\Node provided
@blizzz blizzz mentioned this pull request Dec 5, 2024
This was referenced Dec 9, 2024
Base automatically changed from backport/48563/stable30 to stable30 December 12, 2024 12:32
@skjnldsv skjnldsv merged commit d8c3425 into stable30 Dec 12, 2024
170 of 173 checks passed
@skjnldsv skjnldsv deleted the backport/49293/stable30 branch December 12, 2024 13:19
@blizzz blizzz mentioned this pull request Jan 8, 2025
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants