Project:No request new password
Version:6.x-2.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

On line 49 of norequestnewpass.module you should change

$form['#validate'][2] = 'noreqnewpass_user_login_final_validate';

to

$form['#validate'][] = 'noreqnewpass_user_login_final_validate';

This way if other modules want to override the same forms you will not conflict with them.

Comments

#1

Status:active» closed (fixed)

I need override it to change form error message.

#2

Status:closed (fixed)» active

Hmm - it looks like you already have the code there to pretty much fix this the correct way. I see that you just want to replace the "user_login_final_validate()" function with the "noreqnewpass_user_login_final_validate()" function. Here's the code as it exists now:

  if (($form_id == 'user_login_block' || $form_id == 'user_login') && variable_get('noreqnewpass_disabled', true)) {
    $key = array_search('user_login_final_validate', $form['#validate']);
    $form['#validate'][2] = 'noreqnewpass_user_login_final_validate';
  }

It looks like you started the solution but didn't finish it. Just change the hardcoded "2" to "$key" and you're done!

  if (($form_id == 'user_login_block' || $form_id == 'user_login') && variable_get('noreqnewpass_disabled', true)) {
    $key = array_search('user_login_final_validate', $form['#validate']);
    $form['#validate'][$key] = 'noreqnewpass_user_login_final_validate';
  }

Or am I missing something?

Thanks,
-mike

#3

Version:6.x-1.0» 6.x-2.0

Changing version to 6.x-2.0.

-mike

#4

Status:active» fixed

OMG...

Thanks so much, mike...

Change has been committed.

Pedro Faria

#5

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#6

It seems that there is still a hard-coded "2" in the 6.x-2.0 files!
I made the change according to #2 above and it works fine now, but according to #4 it should be fixed in this release.

Just letting you guys know.