Download & Extend

Modify the User account form to use Email element

Project:HTML5 Tools
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

The form at user/[uid]/edit should use an email form element.
It seems, according to [#316886] that a form_alter won't cut it here.
Haven't worked it out yet, mabe somebody else wil have a pointer.

Comments

#1

Hi alanburke,

thanks for the feature request. The more the merrier :)

Regarding this issue, the form can be alter using hook_user (http://api.drupal.org/api/function/hook_user)

It'll look something like this (note I just threw this together, it will not work, the brackets should be check to make sure they're balance.The form array might be wrong, I'm sure there's something else in there and is not just 'mail'. But this should point you in the right direction :-) )

function hook_user($op, &$edit, &$account, $category = NULL) {
  if ($op == 'form' && $category == 'account') {
    $form['mail']['#type'] = 'emailfield';
    );
   return $form
}

#2

No Joy.
I get a warning from elements module.

Fatal error: Unsupported operand types in projects/html5toolsdev-6/sites/all/modules/elements/elements.module on line 141

Patch attached as a start for anybody else.
AttachmentSize
898914.patch 696 bytes

#3

Status:active» needs review

Here's a working patch.

AttachmentSize
html5_tools-898914.patch 936 bytes

#4

Does the trick for me.
Good work.

#5

Status:needs review» reviewed & tested by the community

changing status because of alanburke's comment above ^^

#6

Status:reviewed & tested by the community» fixed

committed to HEAD

#7

Status:fixed» closed (fixed)

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