On the password reset page, if a user enters a non-existant username or e-mail address, the 'Further instructions have been sent to your e-mail address.' message is shown

The attached patch fixes this issue. It also removes an extraneous message shown if no username or password is given or when the unrecognised username or e-mail address messages are shown.

Comments

fago’s picture

+1
now it works.

so, it doesn't display a message if the user enters nothing any more, but i think this is ok, because the login form works in the same way.

however, usually patches are based in drupal's root dir.
http://drupal.org/patch

fago’s picture

i've noticed a similar problem in user_view()
i think that's a php5 specific issue?

in php5 is something like if ($account = user_load(array('uid' => $uid, 'status' => 1)))
always true. perhaps we should fix user_load() instead?

fago’s picture

Version: » 4.6.3
StatusFileSize
new4.88 KB

i've fixed this everywhere in core, where i found it and created a patch.
as this affects 4.6 too, here is the patch for 4.6

fago’s picture

StatusFileSize
new6.4 KB

and the patch for head

fago’s picture

StatusFileSize
new6.78 KB

sry, i had attached the wrong patch for head.

this is the right one.
please review.

m3avrck’s picture

Version: 4.6.3 » x.y.z

I've changed the status to CVS since this patch affects CVS as well and should go in there first before 4.6.3.

One problem, if I enter a valid email address, I'm getting the error 'Sorry the email address is not recognized'.

Otherwise patch looks great! However, it is slightly out of date against HEAD so should be rerolled to be clean, thanks!

m3avrck’s picture

Status: Needs review » Needs work
fago’s picture

Status: Needs work » Needs review
StatusFileSize
new7.16 KB

right, i fixed that and rerolled the patch for HEAD.

Souvent22’s picture

Status: Needs review » Reviewed & tested by the community

+1. Worked well for me, and more useful to know your username was wrong rather than waiting on a email for nothing. :).

m3avrck’s picture

Just tested here, patch applies cleanly and works as advertised. All outstanding bugs have been fixed, +1 let's get this in, very nice little usability fix :)

fago’s picture

Version: x.y.z » 4.6.3
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new5.71 KB

i fixed the patch for 4.6.

a short summarize of the changes:

  • fixes password mailing for php5 (tested with 5.0.5)
  • removes the 'You must provide either a username or e-mail address.' message, as this would show up on non-valid input too. further the login-form doesn't show a message on a empty input, too -> this is more consistent
  • fixes some potential php5 errors in other modules
fago’s picture

Title: Password reset page - username and e-mail checks don't work » php5: Password reset page - username and e-mail checks don't work

the issue has been fixed recently in head. now user_load() returns false. issue

magico’s picture

Version: 4.6.3 » 4.6.9
Component: user system » user.module
Status: Needs review » Needs work
fago’s picture

what's wrong with the patch? why does it need work?

your review is quite short actually ;)

magico’s picture

In this case, the only reason I marked it (code needs work) is because I've changed the version and so it must be worked for 4.6.9 and then reviewed :)

Don't worry.
Nothing will be left here, I've already reduced from 17 to 11 pages of bugs/features associated to 4.6
In the end, will be left with all patchs and bugs and they will have more time.

magico’s picture

Status: Needs work » Closed (duplicate)

Both 4.7 and HEAD implement the user_load() function returning FALSE as stated by #12.

So, I'm marking this as duplicate in favour of "Request New Password in user.module fails in user_pass()" because it is a much smaller patch that has more chances to be applied (being consistent with the current HEAD)