Hi all,

I just noticed that when "Users cannot change email address" is checked, you cannot submit / edit the user form (at /user).

This is caused by using unset() on the $form array, rather than just setting '#access' => FALSE.

WRONG:

Line 926: unset($form['account']['mail']);

RIGHT:

Line 926: $form['account']['mail']['#access'] = FALSE;

Thanks

Comments

bfroehle’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new1.31 KB

I assume we should do the same for the other unset calls nearby? Patch attached.

Status: Needs review » Needs work

The last submitted patch, 1300998-fix-hide-email.patch, failed testing.

bfroehle’s picture

Hmm, the patch brought back the #1176904: Initial login generates a timezone warning error. Weird. I'll look at this some more when I get a chance, but that won't be for a week or so.

bfroehle’s picture

Status: Needs work » Needs review

#1: 1300998-fix-hide-email.patch queued for re-testing.

bfroehle’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
bfroehle’s picture

StatusFileSize
new1.31 KB

Re-uploading, but against 7.x-1.x-dev instead of 7.x-1.0. This should fix the testbot errors, I think.

bfroehle’s picture

Version: 7.x-1.x-dev » 6.x-3.x-dev
Status: Needs review » Patch (to be ported)

Committed to 7.x-1.x. Thanks for your report.

Should we backport this to 6.x-3.x?

bfroehle’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new1.15 KB

Here's the ported patch for 6.x-3.x. Should clean up some ugly code if this actually works... Untested at the moment.

bfroehle’s picture

Status: Needs review » Fixed

After some manual testing in 6.x-3.x, I discovered:

* For the password field, setting '#access' to FALSE works properly.
* For the e-mail field, setting '#access' to FALSE hides the form field, but validation errors are thrown if the existing value isn't a real e-mail address. Therefore I've left that code as-is.

Committed to 6.x-3.x.

Status: Fixed » Closed (fixed)

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

  • Commit 55deab4 on 7.x-1.x, 8.x-1.x authored by dankobiaka, committed by bfroehle:
    Issue #1300998 by dankobiaka: Fixed Hiding email field from user form...