Fix legacy storage config
This commit is contained in:
parent
f89cc6bd45
commit
839b5b5859
|
@ -81,17 +81,9 @@ class Storage extends BaseAdmin
|
||||||
parent::content($parameters);
|
parent::content($parameters);
|
||||||
|
|
||||||
$current_storage_backend = DI::storage();
|
$current_storage_backend = DI::storage();
|
||||||
$available_storage_backends = [];
|
|
||||||
$available_storage_forms = [];
|
$available_storage_forms = [];
|
||||||
|
|
||||||
// show legacy option only if it is the current backend:
|
|
||||||
// once changed can't be selected anymore
|
|
||||||
if ($current_storage_backend == null) {
|
|
||||||
$available_storage_backends[''] = DI::l10n()->t('Database (legacy)');
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (DI::storageManager()->listBackends() as $name => $class) {
|
foreach (DI::storageManager()->listBackends() as $name => $class) {
|
||||||
$available_storage_backends[$name] = $name;
|
|
||||||
|
|
||||||
// build storage config form,
|
// build storage config form,
|
||||||
$storage_form_prefix = preg_replace('|[^a-zA-Z0-9]|', '', $name);
|
$storage_form_prefix = preg_replace('|[^a-zA-Z0-9]|', '', $name);
|
||||||
|
@ -116,7 +108,7 @@ class Storage extends BaseAdmin
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'prefix' => $storage_form_prefix,
|
'prefix' => $storage_form_prefix,
|
||||||
'form' => $storage_form,
|
'form' => $storage_form,
|
||||||
'active' => $name === $current_storage_backend::getName(),
|
'active' => $current_storage_backend instanceof IStorage && $name === $current_storage_backend::getName(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +124,7 @@ class Storage extends BaseAdmin
|
||||||
'$noconfig' => DI::l10n()->t('This backend doesn\'t have custom settings'),
|
'$noconfig' => DI::l10n()->t('This backend doesn\'t have custom settings'),
|
||||||
'$baseurl' => DI::baseUrl()->get(true),
|
'$baseurl' => DI::baseUrl()->get(true),
|
||||||
'$form_security_token' => self::getFormSecurityToken("admin_storage"),
|
'$form_security_token' => self::getFormSecurityToken("admin_storage"),
|
||||||
'$storagebackend' => $current_storage_backend,
|
'$storagebackend' => $current_storage_backend instanceof IStorage ? $current_storage_backend::getName() : DI::l10n()->t('Database (legacy)'),
|
||||||
'$availablestorageforms' => $available_storage_forms,
|
'$availablestorageforms' => $available_storage_forms,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user