Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/dav/lib/UserMigration/CalendarMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ function (array $componentNames, VObjectComponent $component) {
* @throws CalendarMigratorException
*/
public function import(IUser $user, IImportSource $importSource, OutputInterface $output): void {
if ($importSource->getMigratorVersion(static::class) === null) {
if ($importSource->getMigratorVersion($this->getId()) === null) {
$output->writeln('No version for ' . static::class . ', skipping import…');
return;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/UserMigration/ContactsMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ private function getAddressBookImports(array $importFiles): array {
* @throws ContactsMigratorException
*/
public function import(IUser $user, IImportSource $importSource, OutputInterface $output): void {
if ($importSource->getMigratorVersion(static::class) === null) {
if ($importSource->getMigratorVersion($this->getId()) === null) {
$output->writeln('No version for ' . static::class . ', skipping import…');
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function export(IUser $user, IExportDestination $exportDestination, Outpu
* {@inheritDoc}
*/
public function import(IUser $user, IImportSource $importSource, OutputInterface $output): void {
if ($importSource->getMigratorVersion(static::class) === null) {
if ($importSource->getMigratorVersion($this->getId()) === null) {
$output->writeln('No version for ' . static::class . ', skipping import…');
return;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/settings/lib/UserMigration/AccountMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function export(IUser $user, IExportDestination $exportDestination, Outpu
* {@inheritDoc}
*/
public function import(IUser $user, IImportSource $importSource, OutputInterface $output): void {
if ($importSource->getMigratorVersion(static::class) === null) {
if ($importSource->getMigratorVersion($this->getId()) === null) {
$output->writeln('No version for ' . static::class . ', skipping import…');
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function testImportExportAccount(string $userId, array $importData): void
$this->importSource
->expects($this->once())
->method('getMigratorVersion')
->with(AccountMigrator::class)
->with($this->migrator->getId())
->willReturn(1);

$this->importSource
Expand Down
2 changes: 1 addition & 1 deletion lib/public/UserMigration/IImportSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function getMigratorVersions(): array;
/**
* @return ?int Version for this migrator from the export archive. Null means migrator missing.
*
* @param class-string<IMigrator> $migrator
* @param string $migrator Migrator id (as returned by IMigrator::getId)
*
* @since 24.0.0
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/public/UserMigration/IMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function getVersion(): int;

/**
* Checks whether it is able to import a version of the export format for this migrator
* Use $importSource->getMigratorVersion(static::class) to get the version from the archive
* Use $importSource->getMigratorVersion($this->getId()) to get the version from the archive
*
* @since 24.0.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function getVersion(): int {
public function canImport(
IImportSource $importSource
): bool {
$version = $importSource->getMigratorVersion(static::class);
$version = $importSource->getMigratorVersion($this->getId());
if ($version === null) {
return !$this->mandatory;
}
Expand Down