0

In the Setting of an account on front-end I've added the possibility to change the password. Please enter your current password, then the new

<form id="userform" class="" method="post" accept-charset="UTF-8">

    <input type="hidden" name="action" value="users/saveUser">
    <input type="hidden" name="redirect" value="">
    <input type="hidden" name="userId" value="{{ user.id }}">

    {% macro errorList(errors) %}
        {% if errors %}
            <div class="errors">

                {% for error in errors %}
                    <div>{{ error }}</div>
                {% endfor %}
            </div>
        {% endif %}
    {% endmacro %}

    <input id="password" type="password" autocomplete="off" name="password" class="input-list password" value="">
    <input id="newPassword" type="password" autocomplete="off" name="newPassword" class="input-list password" value="">

    {% if account is defined %}
        {{ errorList(account.getErrors('password')) }} //Current password
        {{ errorList(account.getErrors('password')) }}
        {{ errorList(account.getErrors('newPassword')) }} //New password
        {{ errorList(account.getErrors('newPassword')) }}
    {% endif %}

    <input type="submit" value="Save" class="input-submit">
</form>

Mistakes new password displayed and the error of the current password is not displayed, for example if it is wrong page just reboot and the data will not be saved. How to be

1

Change:

{{ errorList(account.getErrors('password')) }} //Current password

To:

{{ errorList(account.getErrors('currentPassword')) }} //Current password

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.