diff --git a/lib/Jobs/MigrateGroups.php b/lib/Jobs/MigrateGroups.php index 1ce9b9250..caaa31095 100644 --- a/lib/Jobs/MigrateGroups.php +++ b/lib/Jobs/MigrateGroups.php @@ -111,7 +111,7 @@ protected function migrateGroup(string $gid): bool { $qb = $this->dbc->getQueryBuilder(); $affected = $qb->delete('groups') ->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) - ->execute(); + ->executeStatement(); if ($affected === 0) { throw new \RuntimeException('Could not delete group from local backend'); } @@ -141,14 +141,9 @@ protected function getGroupsToMigrate(array $samlGroups, array $pool): array { if ($group === null) { return false; } - $reflected = new \ReflectionClass($group); - $backendsProperty = $reflected->getProperty('backends'); - $backendsProperty->setAccessible(true); - $backends = $backendsProperty->getValue($group); - foreach ($backends as $backend) { - if ($backend instanceof Database) { - return true; - } + $backendNames = $group->getBackendNames(); + if (in_array('Database', $backendNames, true)) { + return true; } return false; });