Skip to content
Snippets Groups Projects

11.2 no longer supports 8000 db updates

Merged Patrick Kenny requested to merge issue/field_encrypt-3524349:11.2_update_test into 4.x
Files
3
+ 52
0
<?php
declare(strict_types=1);
namespace Drupal\field_encrypt\Hook;
use Drupal\Core\Hook\Attribute\Hook;
use Drupal\Core\Update\UpdateHookRegistry;
/**
* Update requirements for field_encrypt.
*/
class FieldEncryptRequirementsHook {
public function __construct(protected UpdateHookRegistry $updateHookRegistry) {
}
/**
* Checks whether the site meets the module requirements.
*/
private function requirementsCheck(): array {
$requirements = [];
$schema = $this->updateHookRegistry->getInstalledVersion('field_encrypt');
if ((int) $schema < 8300) {
$requirements['field_encrypt_update_to_v4'] = [
'title' => t('Field Encrypt'),
'severity' => REQUIREMENT_ERROR,
'value' => t('Updating to field_encrypt version 4 is not supported.'),
'description' => t('In order to upgrade you need to decrypt all your data on the previous version and uninstall the module.'),
];
}
return $requirements;
}
/**
* Implements hook_update_requirements().
*/
#[Hook('update_requirements')]
public function update(): array {
return $this->requirementsCheck();
}
/**
* Implements hook_runtime_requirements().
*/
#[Hook('runtime_requirements')]
public function runtime(): array {
return $this->requirementsCheck();
}
}
Loading