This bug also applies to cvs head:

How to Re-Create:
1. Create a new account via: user/register
2. Submit the blank form
3. You should be prompted with username or email validation errors, but you're not

1. Login and edit your account via: user/edit
2. Delete your username and submit the form
3. You should be prompted with username validation errors, but you're not

1. Login and edit your account via: user/edit
2. Delete your email address and submit the form
3. The form is fully processed and written to the database without any validation errors.

How to patch:
diff -u -r1.251 user.module
--- user.module 13 Nov 2003 19:52:54 -0000 1.251
+++ user.module 15 Nov 2003 22:57:45 -0000
@@ -198,6 +198,7 @@
}

function user_validate_mail($mail) {
+ if (!$mail) return t("You must enter an email address.");
if ($mail && !valid_email_address($mail)) {
return t("The e-mail address '%mail' is not valid.", array("%mail" => $mail));
}
@@ -792,7 +793,7 @@
drupal_goto(url("user/edit"));
}

- if ($edit["name"] && $edit["mail"]) {
+ if (!(is_null($edit["name"]) && is_null($edit["mail"]))) {
if ($error = user_validate_name($edit["name"])) {
// do nothing
}
@@ -913,7 +914,7 @@
global $user;

if ($user->uid) {
- if ($edit["name"]) {
+ if (!(is_null($edit["name"]) && is_null($edit["mail"]))) {
if ($error = user_validate_name($edit["name"])) {
// do nothing
}

Comments

matt westgate’s picture

Assigned: Unassigned » matt westgate

patched in 4.3 and HEAD

Anonymous’s picture

ax’s picture

marking this ACTIVE again as the patch looks buggy to me. try to change your user settings at drupal.org. i get a "You must enter an e-mail address." - even though it is there. if this isn't caused by this patch, CLOSE it again.

matt westgate’s picture

I cannot reproduce this in a clean 4.3.1 install or CVS HEAD following the three different use-cases given here. The reason Drupal is failing is most likely due to a profile module bug i reported earlier.