Commit 18e71236 authored by git's avatar git Committed by Alexander Hass
Browse files

[user:name-raw] token checks in install should not be flagged as errors

parent 8fb06a75
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -55,24 +55,24 @@ function realname_requirements($phase) {
      $requirements['user_mail_register_admin_created_body'] = array(
        'title' => t('E-mail: "Welcome (new user created by administrator)" template'),
        'value' => t('Not configured'),
        'severity' => REQUIREMENT_ERROR,
        'description' => t('Replace the token <code>[user:name]</code> with <code>[user:name-raw]</code> in <a href="@people">e-mail</a> template.', array('@people' => url('admin/config/people/accounts', array('fragment' => 'edit-email-admin-created')))),
        'severity' => REQUIREMENT_WARNING,
        'description' => t('Replace the token <code>[user:name]</code> with <code>[user:name-raw]</code> in <a href="@people">e-mail</a> template, if using username for login.', array('@people' => url('admin/config/people/accounts', array('fragment' => 'edit-email-admin-created')))),
      );
    }
    if (!strpos(variable_get('user_mail_register_no_approval_required_body', FALSE), '[user:name-raw]')) {
      $requirements['user_mail_register_no_approval_required_body'] = array(
        'title' => t('E-mail: "Welcome (no approval required)" template'),
        'value' => t('Not configured'),
        'severity' => REQUIREMENT_ERROR,
        'description' => t('Replace the token <code>[user:name]</code> with <code>[user:name-raw]</code> in <a href="@people">e-mail</a> template.', array('@people' => url('admin/config/people/accounts', array('fragment' => 'edit-email-no-approval-required')))),
        'severity' => REQUIREMENT_WARNING,
        'description' => t('Replace the token <code>[user:name]</code> with <code>[user:name-raw]</code> in <a href="@people">e-mail</a> template, if using username for login.', array('@people' => url('admin/config/people/accounts', array('fragment' => 'edit-email-no-approval-required')))),
      );
    }
    if (!strpos(variable_get('user_mail_status_activated_body', FALSE), '[user:name-raw]')) {
      $requirements['user_mail_status_activated_body'] = array(
        'title' => t('E-mail: "Account activation" template'),
        'value' => t('Not configured'),
        'severity' => REQUIREMENT_ERROR,
        'description' => t('Replace the token <code>[user:name]</code> with <code>[user:name-raw]</code> in <a href="@people">e-mail</a> template.', array('@people' => url('admin/config/people/accounts', array('fragment' => 'edit-email-activated')))),
        'severity' => REQUIREMENT_WARNING,
        'description' => t('Replace the token <code>[user:name]</code> with <code>[user:name-raw]</code> in <a href="@people">e-mail</a> template, if using username for login.', array('@people' => url('admin/config/people/accounts', array('fragment' => 'edit-email-activated')))),
      );
    }
  }
+1 −1
Original line number Diff line number Diff line
@@ -431,7 +431,7 @@ function realname_username_raw_token_validate(&$element, &$form_state) {
  $value = isset($element['#value']) ? $element['#value'] : $element['#default_value'];

  if (!strpos($value, '[user:name-raw]')) {
    form_error($element, t('The %element-title does not contain <code>[user:name-raw]</code> token.', array('%element-title' => $element['#title'])));
    drupal_set_message(t('The %element-title does not contain the <code>[user:name-raw]</code> token, which is necessary when using username for login when the Real Name module is enabled.', array('%element-title' => $element['#title'])), 'warning');
  }

  return $element;