You are here

function fpa_form_user_admin_permissions_alter in Fast Permissions Administration 8.2

Same name in this branch
  1. 8.2 fpa.module \fpa_form_user_admin_permissions_alter()
  2. 8.2 fpa.form_alter.inc \fpa_form_user_admin_permissions_alter()
Same name and namespace in other branches
  1. 7.2 fpa.form_alter.inc \fpa_form_user_admin_permissions_alter()
  2. 3.0.x fpa.module \fpa_form_user_admin_permissions_alter()

Implements hook_form_FORM_ID_alter().

File

./fpa.module, line 38
Main module file for FPA.

Code

function fpa_form_user_admin_permissions_alter(&$form, &$form_state) {

  // Prevent duplication of memory limit warning.
  $filter_perm_exists = \Drupal::service('module_handler')
    ->moduleExists('filter_perms');
  if ($filter_perm_exists && empty($form_state
    ->getUserInput())) {
    $memory_limit = ini_get('memory_limit');
    if (!FPAFormBuilder::checkMemoryLimit()) {
      \Drupal::messenger()
        ->addWarning(t('If you attempt to display all roles and permissions on this page at the same time, you will most likely exceed your PHP memory limit of %memory_limit.', [
        '%memory_limit' => $memory_limit,
      ]));
    }
  }
}