From c4cef6af1f8eb871fd8816ada45fd3f87d64cfcc Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Tue, 22 Oct 2024 09:33:18 -0100 Subject: [PATCH] fix min length for circle name Signed-off-by: Maxence Lange --- lib/Command/MigrateCustomGroups.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Command/MigrateCustomGroups.php b/lib/Command/MigrateCustomGroups.php index 15c1162cc..a8f2cdf93 100644 --- a/lib/Command/MigrateCustomGroups.php +++ b/lib/Command/MigrateCustomGroups.php @@ -76,13 +76,18 @@ public function migrateTeams(): void { continue; // if group or owner is not know, we ignore the entry. } + $name = $rowCG['display_name']; + while(strlen($name) < 3) { + $name = '_' . $name; + } + // based on owner's userid, we create federateduser and a new circle - $this->output->writeln('+ New Team ' . $rowCG['display_name'] . ', owner by ' . $ownerId . ''); + $this->output->writeln('+ New Team ' . $name . ', owner by ' . $ownerId . ''); $owner = $this->cachedFed($ownerId); $this->circlesManager->startSession($owner); try { - $circle = $this->circlesManager->createCircle($rowCG['display_name']); + $circle = $this->circlesManager->createCircle($name); } catch (\Exception $e) { $this->output->writeln('' . get_class($e) . ' ' . $e->getMessage() . ' with data ' . json_encode($rowCG)); $this->logger->log(2, 'error while creating circle', ['exception' => $e]);