Skip to content
Snippets Groups Projects

Issue #3512611 Update crypt method names stored in state.

+ 21
0
@@ -34,3 +34,24 @@ function drd_agent_update_8001(mixed &$sandbox): void {
$config->delete();
}
/**
* Update stored crypt methods after 4.1.3 update.
*/
function drd_agent_update_8002(): void {
$state = \Drupal::state();
$authorized = $state->get('drd_agent.authorised');
// Check if old state values exists.
if ($authorized !== NULL) {
foreach ($authorized as $uuid => $settings) {
match($settings['crypt']) {
'OpenSSL' => $authorized[$uuid]['crypt'] = 'OpenSsl',
'TLS' => $authorized[$uuid]['crypt'] = 'Tls',
default => NULL,
};
}
$state->set('drd_agent.authorised', $authorized);
}
}
Loading