I have problem in customer/account/edit/ page the customer can't update his information without fill current password field even if he doesn't checked the change password checkbox, if the customer try to change his date this message will appear "Invalid current password"

Anyone could help me please ?

The codes used

<li class="control">
    <input type="checkbox" name="change_password" id="change_password" value="1" onclick="setPasswordForm(this.checked)" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Change Password')) ?>"<?php if($this->getCustomer()->getChangePassword()==1): ?> checked="checked"<?php endif; ?> class="checkbox" /><label for="change_password"><?php echo $this->__('Change Password') ?></label>
<li class="fields">
    <label for="current_password" class="required"><em>*</em><?php echo $this->__('Current Password') ?></label>
    <div class="input-box">
        <!-- This is a dummy hidden field to trick firefox from auto filling the password -->
        <input type="text" disabled class="input-text no-display" name="dummy" id="dummy" />
        <input type="password" disabled title="<?php echo Mage::helper('core')->quoteEscape($this->__('Current Password')) ?>" class="input-text" name="current_password" id="current_password" />
<li class="fields">
        <label for="password" class="required"><em>*</em><?php echo $this->__('New Password') ?></label>
        <div class="input-box">
            <input type="password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('New Password')) ?>" class="input-text validate-password" name="password" id="password" />
<li class="fields">
    <label for="confirmation" class="required"><em>*</em><?php echo $this->__('Confirm New Password') ?></label>
    <div class="input-box">
        <input type="password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Confirm New Password')) ?>" class="input-text validate-cpassword" name="confirmation" id="confirmation" />

    var dataForm = new VarienForm('form-validate', true);
    function setPasswordForm(arg){
        if (arg){

        } else {

    <?php if($this->getCustomer()->getChangePassword()): ?>
    <?php endif; ?>

You have to change app/code/core/Mage/Customer/controllers/AccountController.php

For this behavoir these lines have to be moved after if ($customer->getIsChangePassword()) {

if (!$customer->validatePassword($this->getRequest()->getPost('current_password'))) {
    $errors[] = $this->__('Invalid current password');

... BUT you shouldn't do this!

-1 IMHO this validation is fine like it is. If developer's intention was to check current password just for changing password this input would be hidden until marking checkbox "change password".


IMHO to edit non-passwords account data from version you have to provide current password too.

Magento CE Release Notes, section Password enhancements

  • When a user changes their e-mail address, they are required to provide their password and to acknowledge the change from the previous address.

Had same question/problem in the past ... and have closes this pull request.

  • 1
    Thaaanks bro! Perfect. solved the problem. But I followed your recommendation, put the password confirmation outside of the div to maintain data security hugs. – MichaelCosta Jul 16 '17 at 22:44

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.