Register repair step for group migrations

Signed-off-by: Giuliano Mele <giuliano.mele@verdigado.com>
This commit is contained in:
Giuliano Mele 2021-09-08 14:17:01 +02:00 committed by Jonathan Treffler
parent e6effba008
commit 9deba64f14
3 changed files with 9 additions and 1 deletions

View file

@ -46,4 +46,9 @@ While theoretically any other authentication provider implementing either one of
<admin>OCA\User_SAML\Settings\Admin</admin>
<admin-section>OCA\User_SAML\Settings\Section</admin-section>
</settings>
<repair-steps>
<post-migration>
<step>OCA\User_SAML\Migration\RememberLocalGroupsForPotentialMigrations</step>
</post-migration>
</repair-steps>
</info>

View file

@ -173,6 +173,9 @@ class GroupManager
null
);
$strictBackendCheck = null === $migrationWhiteList;
if ($migrationWhiteList !== null) {
$migrationWhiteList = \json_decode($migrationWhiteList, true);
}
if(!$strictBackendCheck && in_array($gid, $migrationWhiteList['groups'], true)) {
$group = $this->groupManager->get($gid);
if($group === null) {

View file

@ -140,7 +140,7 @@ class MigrateGroups extends QueuedJob {
$reflected = new \ReflectionClass($group);
$backendsProperty = $reflected->getProperty('backends');
$backendsProperty->setAccessible(true);
$backends = $backendsProperty->getValue();
$backends = $backendsProperty->getValue($group);
foreach ($backends as $backend) {
if($backend instanceof Database) {
return true;