Unmount the share before deleting it, so we don't try to use it later on
This commit is contained in:
parent
cce6194368
commit
3dac3a01c5
|
@ -203,9 +203,15 @@ class TransferOwnership extends Command {
|
||||||
private function restoreShares(OutputInterface $output) {
|
private function restoreShares(OutputInterface $output) {
|
||||||
$output->writeln("Restoring shares ...");
|
$output->writeln("Restoring shares ...");
|
||||||
$progress = new ProgressBar($output, count($this->shares));
|
$progress = new ProgressBar($output, count($this->shares));
|
||||||
|
$mountManager = Filesystem::getMountManager($this->destinationUser);
|
||||||
|
|
||||||
foreach($this->shares as $share) {
|
foreach($this->shares as $share) {
|
||||||
if ($share->getSharedWith() === $this->destinationUser) {
|
if ($share->getSharedWith() === $this->destinationUser) {
|
||||||
|
// Unmount the shares before deleting, so we don't try to get the storage later on.
|
||||||
|
$shareMountPoint = $mountManager->find('/' . $this->destinationUser . '/files' . $share->getTarget());
|
||||||
|
if ($shareMountPoint) {
|
||||||
|
$mountManager->removeMount($shareMountPoint->getMountPoint());
|
||||||
|
}
|
||||||
$this->shareManager->deleteShare($share);
|
$this->shareManager->deleteShare($share);
|
||||||
} else {
|
} else {
|
||||||
if ($share->getShareOwner() === $this->sourceUser) {
|
if ($share->getShareOwner() === $this->sourceUser) {
|
||||||
|
|
Loading…
Reference in New Issue