In the user profiles on groups.drupal.org, there are two website fields: "Organization Website" on http://groups.drupal.org/user/#####/edit/Business
and "Website" on http://groups.drupal.org/user/#####/edit/Personal
These fields do not link properly unless they are prefixed with http://
, and there is no indication in the field description that this prefix is required. I see a large number of profiles where people don't do use the prefix, and their link links to a g.d.o path instead of the URL.
Typical behavior online when a profile asks for a website is to assume that it is an absolute URL and not require the http://
prefix, but accept it if it's given. The fields on g.d.o should behave the same way.
Comment | File | Size | Author |
---|---|---|---|
#19 | remove-profile-url-field-validation-D6.patch | 1.58 KB | amateescu |
#18 | profile-url-field-D6.patch | 862 bytes | amateescu |
#10 | profile.module.patch | 683 bytes | theunraveler |
#8 | profile.module.patch | 690 bytes | theunraveler |
#6 | profile.module.patch | 690 bytes | theunraveler |
Comments
Comment #1
gregglesfwiw, I consider this a bit of protection against idiot spammers...
It may also be just the way that the profile module works and therefore something we need to fix in core first.
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedBad usability is not good spam protection, but it is a good way to drive away users.
Comment #3
gregglesOk. It's really a 7.x core bug afaict.
Comment #4
FiNeX CreditAttribution: FiNeX commentedThis bug affects Drupal 6 too. At least an hint should be provided.
Comment #5
gregglesComment #6
theunraveler CreditAttribution: theunraveler commentedI made a little patch that checks to see if the link begins with 'http://' and, if it doesn't, append that to the beginning of the URL. Links that do contain 'http://' should remain untouched. I'm not sure if this is the best way to do it, but it works.
Comment #8
theunraveler CreditAttribution: theunraveler commentedRe-uploading patch, now with Unix line endings!
Comment #10
theunraveler CreditAttribution: theunraveler commentedTrying again...
Comment #12
cburschkaIsn't cleaning up broken input one of the things we try to avoid in Drupal? It seems a better idea to pick this up in validation and prevent users from entering invalid URLs in the first place...
Comment #13
SamRose CreditAttribution: SamRose commentedpick this up in validation and prevent users from entering invalid URLs in the first place...
Drupal seems to be doing the validation already.
The funny thing is, if you DO NOT give Drupal some form of rule for what to prepend a URL with, Drupal will prepend with $base_url
So, no matter which way you cut it, Profile URL fields on a basic level, are unfinished input functionality in Drupal core.
Comment #15
carsonwIs there a patch available for Drupal 6.x? If not, would you please consider providing one?
Comment #16
gagarine CreditAttribution: gagarine commentedI think (I don't try the patch, just read it sorry) the patch on #10 have a bug. It look for "http://" and add it if it's not present. But you can have an url with "https://" or other protocol. So if we have the url "https://site.com" they become "http://https://site.com" :(.
I think if no protocol is specified in the url by the user it's a good thinks to assume is http.
What about http://us3.php.net/manual/en/function.parse-url.php ?
Comment #17
momper CreditAttribution: momper commentedone of the most needless bugs in drupal since years - would someone solve the problem in a smart and clean (take into account the remark of #16) way for 100$ (paypal) until monday for drupal6? i'm a themer and need a solution without hours of research ...
thanks momper
Comment #18
amateescu CreditAttribution: amateescu commentedDrupal 6 does validate the url profile field, but only in the profile edit form, not in the registration one. For example, you can register with a url like www.example.com but this field will fail validation when you try to edit your profile.
After some digging around, I found out that _profile_get_fields in the profile_validate_profile function doesn't return anything on the registration form, and because I couldn't get to the bottom of this issue, i'm attaching a patch for D6 that will fix the field output using parse_url(), as suggested in #16.
Comment #19
amateescu CreditAttribution: amateescu commentedHere is a patch for D6 which also disables url validation in the profile edit form.
Since the field doesn't have any description to tell users that the protocol is required, maybe some sites will find this behaviour desirable.
Comment #20
momper CreditAttribution: momper commentedi hope the solution of amateescu will help someone - thanks to him ...
Comment #21
tomsm CreditAttribution: tomsm commented#19 works great. Thank you/
I use drupal 6.20.
Comment #22
tomsm CreditAttribution: tomsm commentedAlso works with 6.22.
Comment #23
acolyte26 CreditAttribution: acolyte26 commented#10: profile.module.patch queued for re-testing.
Comment #25
tomsm CreditAttribution: tomsm commentedI have found a problem with the patch #19:
When a user wants to edit its profile with required fields, he always gets the message that there are required fields, even when they are filled. So he is unable to change its profile.