@ -79,10 +79,10 @@ class TrashbinMigrator implements IMigrator {
$output->writeln("Exporting trashbin files…");
$exportDestination->copyFolder($trashbinFolder, static::PATH_FILES_FOLDER);
$originalLocations = \OCA\Files_Trashbin\Trashbin::getLocations($uid);
$exportDestination->addFileContents(static::PATH_LOCATIONS_FILE, json_encode($originalLocations);
$exportDestination->addFileContents(static::PATH_LOCATIONS_FILE, json_encode($originalLocations)) ;
} catch (NotFoundException $e) {
$output->writeln("No trashbin to export…");
} catch (UserMigrationException $e) {
} catch (\Throwable $e) {
throw new UserMigrationException("Could not export trashbin: ".$e->getMessage(), 0, $e);
}
}
@ -110,8 +110,10 @@ class TrashbinMigrator implements IMigrator {
$trashbinFolder = $this->root->newFolder('/'.$uid.'/files_trashbin');
}
$output->writeln("Importing trashbin files…");
if ($importSource->copyToFolder($trashbinFolder, static::PATH_FILES_FOLDER) === false) {
throw new UserMigrationException("Could not import trashbin.");
try {
$importSource->copyToFolder($trashbinFolder, static::PATH_FILES_FOLDER);
} catch (\Throwable $e) {
throw new UserMigrationException("Could not import trashbin.", 0, $e);
}
$locations = json_decode($importSource->getFileContents(static::PATH_LOCATIONS_FILE), true, 512, JSON_THROW_ON_ERROR);
$qb = $this->dbc->getQueryBuilder();