php - Magento password reset error when gender and/or date of birth is required -


I'm running 1.7.0.2. Magento website For this website, I have recently activated the "gender" and "date of birth" option for users. This means that some existing users have not yet filled up their gender and date of birth. The problem is, if any of these users have forgotten their password and tries to reset it, they receive the following error:

 Date of birth is required Gender requires your password reset link Is finished. 

This error comes after typing their favorite new password and submitting this entry.

When "gender" and "birth date" are not required, the password reset works normally.

I have been found only on this subject, but no answer yet.

You Mage_Customer_AccountController controller resetPasswordPostAction ()

After override your function, such a way

  reset the public function PasswordPostAction () {$ resetPasswordLinkToken = (string) $ this- & gt; GetRequest () - & gt; GetQuery ('token'); $ Customer Id = (int) $ this- & gt; GetRequest () - & gt; GetQuery ('id'); $ Password = (string) $ this- & gt; GetRequest () - & gt; GetPost ('password'); $ PasswordConfirmation = (string) $ this- & gt; GetRequest () - & gt; GetPost ('confirmation'); {$ This-> Try _validateResetPasswordLinkToken ($ customerId, $ resetPasswordLinkToken); } Hold (exception $ exception) {$ this-> _getSession () - & gt; AddError (Dana :: helper ('customer') - & gt; __ ('Your password reset link has expired.')); $ This- & gt; _redirect ('* / * /'); Return; } $ ErrorMessages = array (); If (iconv_strlen ($ password) & lt; = 0} {array_push ($ error message, grain :: helper ('customer') -> gtk ('new password field can not be empty')); } / ** $ $$ Customer Mage_Customer_Model_Customer * / $ Customer = Dana :: MillModel ('Customer / Customer') - & gt; Load ($ customer ID); $ Customer & gt; SetPassword ($ password); $ Customer & gt; SetConfirmation ($ passwordConfirmation); $ Validation Error Message = $ Customer- & gt; Valid (); If (is_array ($ validationErrorMessages)) {// $ errorMessages = array_merge ($ errorMessages, $ validationErrorMessages); } If (! Error ($ error message)) {$ this- & gt; _getSession () - & gt; SetCustomerFormData ($ this-> getRequest () - & gt; getPost ()); Forex Currency ($ error $ message as error message) {$ this-> _getSession () - & gt; Ad error ($ error message); } $ This- & gt; _redirect ('* / * / resetpassword', array ('id' = & gt; $ customer ID, 'token' => $ resetPasswordLinkToken)); Return; } Try {// blank current reset password token i.e. This $ customer is invalid- & gt; SetRpToken (empty); $ Customer & gt; SetRpTokenCreatedAt (zero); $ Customer & gt; SetConfirmation (zero); $ Customer & gt; Save (); $ This- & gt; _getSession () - & gt; Adsuit (MIG :: Helper ('customer') - & gt; __ ('Your password has been updated.')); $ This- & gt; _redirect ('* / * / login'); } Hold (exception $ exception) {$ this-> _getSession () - & gt; Add Exception ($ Exception, $ this-> __ ('Can not save new password.')); $ This- & gt; _redirect ('* / * / resetpassword', array ('id' = & gt; $ customer ID, 'token' => $ resetPasswordLinkToken)); Return; }}  

I have commented on line number 646 from the above work

  $ errorMessages = array_merge ($ errorMessages, $ validationErrorMessages);  

Comments