it happened again. I got the solution less than 1 hour after posting the question.
But before posting it I want to say that this looks like a Magento bug to me.
Customers should be able to change their password even if the customer settings have been changed.
The obvious thing to do is to remove the line (and other ones related to it)
$validationErrorMessages = $customer->validate();
from the Mage_Customer_AccountController::resetPasswordPostAction
.
I don't think a full validation is required here since we are changing only the password.
All the other fields can be changed once the customer gets access to his account. (FOR WHICH HE NEEDS A PASSWORD)
But I didn't remove that, in case there is an other reason that I'm missing.
Here is what I did just for this particular case.
Since I only need to skip this validation on the recover password page, I observed the event controller_action_predispatch_customer_account_resetpasswordpost
and just registered a value.
<events>
<controller_action_predispatch_customer_account_resetpasswordpost>
<observers>
<[namespace]_[module]>
<class>[namespace]_[module]/observer</class>
<method>skipDobValidation</method>
</[namespace]_[module]>
</observers>
</controller_action_predispatch_customer_account_resetpasswordpost>
</events>
and the observer method looks like this:
public function skipDobValidation($observer) {
Mage::register('skip_dob_validation', true);
return $this;
}
And I've overwritten the validate
method in the customer model. I didn't find an event for it.
Basically it looks the same as in Mage_Customer_Model_Customer
except for this part.
if ($attribute->getIsRequired() && '' == trim($this->getDob())) {
$errors[] = Mage::helper('customer')->__('The Date of Birth is required.');
}
In my class it looks like this:
$skipDobValidation = Mage::registry('skip_dob_validation');
if (!$skipDobValidation) {
if ($attribute->getIsRequired() && '' == trim($this->getDob())) {
$errors[] = Mage::helper('customer')->__('The Date of Birth is required.');
}
}
This could have several causes, and its possible a module its interfering. Have you added any recently? Try disabling all of them but the Magento defaults and see if the problem goes away.
It could also be related to patch 6788 if you applied it recently.
Best Answer
Check your email templates. By default, email templates are under
System > Transactional Emails
. Normally the password reset email shouldn't be there, but check if a module put one there.Then check
app/locale/en_US/template/email/account_password_reset_confirmation.html
. That file should look like this:Also check
app/design/frontend/{your_package}/{your_theme}/locale/en_US/
and see if there is atemplate/email
folder overriding email templates.