-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
[stable26] fix: catch ManuallyLockedException and use app context #38043
Conversation
The files_lock app may throw ManuallyLockedExceptions when attempting to revert a file that is currently opened. This would prevent the user from rolling back a opened file. Text and Richdocuments handle changes of the file while editing. Allow reverting files even when they are locked by these apps and let the apps handle the conflict. Signed-off-by: Max <[email protected]>
$storage1->unlink($internalPath1); | ||
try { | ||
// TODO add a proper way of overwriting a file while maintaining file ids | ||
if ($storage1->instanceOfStorage('\OC\Files\ObjectStore\ObjectStoreStorage') || $storage2->instanceOfStorage('\OC\Files\ObjectStore\ObjectStoreStorage')) { |
Check notice
Code scanning / Psalm
ArgumentTypeCoercion
$storage1->unlink($internalPath1); | ||
try { | ||
// TODO add a proper way of overwriting a file while maintaining file ids | ||
if ($storage1->instanceOfStorage('\OC\Files\ObjectStore\ObjectStoreStorage') || $storage2->instanceOfStorage('\OC\Files\ObjectStore\ObjectStoreStorage')) { |
Check notice
Code scanning / Psalm
ArgumentTypeCoercion
if ($storage1->instanceOfStorage('\OC\Files\ObjectStore\ObjectStoreStorage') || $storage2->instanceOfStorage('\OC\Files\ObjectStore\ObjectStoreStorage')) { | ||
$source = $storage1->fopen($internalPath1, 'r'); | ||
$target = $storage2->fopen($internalPath2, 'w'); | ||
[, $result] = \OC_Helper::streamCopy($source, $target); |
Check notice
Code scanning / Psalm
PossiblyInvalidArgument
if ($storage1->instanceOfStorage('\OC\Files\ObjectStore\ObjectStoreStorage') || $storage2->instanceOfStorage('\OC\Files\ObjectStore\ObjectStoreStorage')) { | ||
$source = $storage1->fopen($internalPath1, 'r'); | ||
$target = $storage2->fopen($internalPath2, 'w'); | ||
[, $result] = \OC_Helper::streamCopy($source, $target); |
Check notice
Code scanning / Psalm
PossiblyInvalidArgument
$source = $storage1->fopen($internalPath1, 'r'); | ||
$target = $storage2->fopen($internalPath2, 'w'); | ||
[, $result] = \OC_Helper::streamCopy($source, $target); | ||
fclose($source); |
Check notice
Code scanning / Psalm
PossiblyInvalidArgument
$target = $storage2->fopen($internalPath2, 'w'); | ||
[, $result] = \OC_Helper::streamCopy($source, $target); | ||
fclose($source); | ||
fclose($target); |
Check notice
Code scanning / Psalm
PossiblyInvalidArgument
backport of #37787