function PhpassHooks::formSystemModulesUninstallConfirmFormAlter

Implements hook_form_FORM_ID_alter() for system_modules_uninstall_confirm_form.

Attributes

#[Hook('form_system_modules_uninstall_confirm_form_alter')]

File

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

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($this->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.