Optional URL
ryo - September 29, 2008 - 12:01
| Project: | Link |
| Version: | 5.x-2.5 |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
In "/admin/content/types/contenttype/fields/field_fieldname", there is an instruction which says
"If checked, the URL field is optional and submitting a title alone will be acceptable.
If the URL is ommitted, the title will be displayed as plain text. "
But the reality is when you submit a title alone and leave a url fileld blank, the url becomes the site URL...
Am I missing something?

#1
Have you changed the formatter to something besides the default? If you could visit "/admin/content/types/[type]/display" and report what formatter you're using for the link field, that might help pin this down. It seems to be working as intended for me when using the default.
#2
Ah, my fault... I was using the formatter "URL, as link"...
After having changed it to default (Title, as link) as you mentioned, it works as intended.
Thanks for the reply and sorry for my misunderstanding.
#3
Thanks for the followup. I'll take a look at this and try to come up with some kind of solution (maybe a validation error on the display fields page). The two options used together don't make any sense, as you can't really display a URL if a user didn't enter one. :P
#4
Well, I'm using this module to build a site which is a kind of business directory, and... to be honest, my hope has been that if I don't unter a URL using the formatter "URL, as link", then the field remains blank, representing that a company doesn't have its homepage...
But I noticed that when I did so, the URL field went to the site URL, that's why I posted this issue.
Am I making myself clear and would it be difficult to make the URL field remain blank when you don't enter a URL using the formatter "URL, as link" ?
Anyhow, I appreciate this useful module. Thanks a lot.
#5
Ah, okay that makes sense. I also think the default behavior should be to not display anything at all if the user didn't enter a URL.
#6
Does anyone have an update for Drupal version 6? I am having the same problem as the original post with no url being put in, and the link still displaying. Any help would be appreciated.