function PhpassHooks::formSystemModulesUninstallConfirmFormAlter

Implements hook_form_FORM_ID_alter() for system_modules_uninstall_confirm_form.

File

core/modules/phpass/src/Hook/PhpassHooks.php, line 36

Class

PhpassHooks
Hook implementations for phpass.

Namespace

Drupal\phpass\Hook

Code

public function formSystemModulesUninstallConfirmFormAlter(array &$form, FormStateInterface $form_state) : void {
    $modules = \Drupal::keyValueExpirable('modules_uninstall')->get(\Drupal::currentUser()->id());
    if (!in_array('phpass', $modules)) {
        return;
    }
    \Drupal::messenger()->addWarning(t('Make sure that you can log in before uninstalling the Password Compatibility module. For more information, see the <a href=":phpass">online documentation for the Password Compatibility module</a>.', [
        ':phpass' => 'https://www.drupal.org/docs/core-modules-and-themes/core-modules/password-compatibility-module',
    ]));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.