In the modules/user/user.module on line 1448 there is not size parameter for the account-name textfield. Because of this the textfield is a whopping 80 characters long ! While the maximum size for the account-name is set to 60 characters.
This makes no sense and in fact in certain themes (like the Burnt theme) it causes problems because the table is so wide things become invisible and useless (like the theme selection which has a checkbox at the extreme right which is underneath the right pane).
The same problem with the the account-email textfield on line 1456. This textfield is also 80 characters in size while the max email size is set to 65. Both require a:
'#size' => 25,
to make it acceptable.
I added a screenshot to make it more clear.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 368283_before.png | 209.79 KB | shawn dearmond |
| #4 | 368283_after.png | 209.78 KB | shawn dearmond |
| #2 | user.module-368283.patch | 1.18 KB | shawn dearmond |
| Screenshot-Drupal-theme-problem.png | 114.31 KB | dag- | |
| Screenshot-Drupal-textfield-width.png | 105.44 KB | dag- |
Comments
Comment #1
brianV commentedThis would be a good Novice task.
Comment #2
shawn dearmond commentedHere's a patch.
I matched the size defined in user.install. That means 60 for name and 64 for mail.
Comment #3
catchCould you post a before/after screenshot for this?
Comment #4
shawn dearmond commentedScreenshots attached.
Comment #5
dale42In this instance basing the email form field length on the actual field length probably isn't a good idea. Per #470306: User email column too short (only 64 chars, should be 255), there is talk of expanding the length of the email field in the database.
In addition to being used on user/%/edit, I believe this form is also used on admin/user/user/create.
I checked with Firebug and see that size=60 is currently being used for the Username and E-Mail form fields on HEAD. Looking at the code, I see the size isn't explicitly set in the form definition, so this must be a form API default?:
A value of 60 strikes me as a reasonable size for both fields, and I think the form looks better if they are an equal size. Given a possible change in email db length, adding an additional 4 characters to the form's email field doesn't seem worth it.
Given the current default value appears to be 60, I'm not sure any action is required. If it's worth giving the form field sizes an explicit value, I vote both be set to 60.
Also, the original bug report was as much a bug report for a specific theme as it was for user module behaviour. Estimating sizes based on the screen shots provided, I'd say the reported problem still won't be solved by changing form field lengths to 60. A bug report should probably be filed on the theme in question.
Comment #6
dale42In hindsight, may have been more concise to state as follows:
In Drupal 7 the username and email form fields are currently size=60 (set implicitly)
What is a reasonable length for these fields, size=60, size=25 as suggested in submission, or something in between?
If size=60 is the answer, should this be explicitly set? If answer is no, then no further action is required.
Is there any way to gather username and email length stats from D.O. to get an idea of typical username and email lengths? That might help determine the answer to ideal field length. Or is that overkill?
Comment #7
shawn dearmond commentedThat's reasonable. Any other comments before we mark this "Won't Fix"?
Comment #9
Amazon commentedBad bot.
Comment #10
andypostbot was failed
Comment #11
arianek commentedconferred with webchick, and going to mark this as "won't fix" it does not appear to be necessary, or much of an improvement aesthetically - if it's really a problem, it can be overridden in the theme. it's arbitrary to shrink down long fields to only be able to show 25 chars rather than the full amt of characters allowed - and in this case, it looks like it's largely because of the theme used in the example that it looks so drastic.