modxcms/Login

[Register] Password Confirm validation issue

Opened this issue · 0 comments

Using MODX 2.6.1 / Login 1.9.5

Issue

If the register snippet is posted blank by mistake, the password_confirm field loads directly a lexicon value (register.password_not_confirmed), which is not assigned to an error message tpl (for example, vTextPasswordConfirm), so cannot be overridden in the snippet call and customised like the rest of the error messages.

If you want to customise the output of these error messages on the snippet call, this won't be possible.

loginvalidator.class.php - line 372

if (empty($value)) return $this->modx->lexicon('register.password_not_confirmed');

^ Code in question...this loads a lexicon if the password_confirm and password fields are empty (which seems inconsistent with how the rest of the code handles errors below).

Expected behaviour

To be able to customise this particular error message in the register snippet call and for it to not load directly a lexicon value.

if (empty($value)) {
    return $this->_getErrorMessage($key,'vTextPasswordConfirm','register.password_dont_match',array(
        'field' => $key,
        'password' => $value,
        'password_confirm' => $confirm,
    ));
}

^ I appreciate this makes the lexicon value (register.password_not_confirmed) redundant, but actually from a UX perspective, it makes sense to join "register.password_dont_match".