On node save, any field set as a URL gets trunked to "h" from http://* or https://*. This makes these fields unusable.

CommentFileSizeAuthor
#3 html5tools_urlwidget.patch677 bytesBerdir
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ericduran’s picture

Is this with or without the link module?

ericduran’s picture

Title: URL Fields all save as "h" » URL widget all save as "h" when using with text field

I just tested this out with the link field and it seems to work as expected.

I'm guessing the bug is when using it with a textfield right?

I'm changing the title to reflect that, also I would strongly recommend you use the url field with the link module. Because you'll get extra options such as the title text for the field :)

Berdir’s picture

Priority: Normal » Major
Status: Active » Needs review
FileSize
677 bytes

Yeah, the problem is that you are unconditionally returning the $element for the url widget, so it is not inside the value key for the textfield type.

The attached patch makes the early return for urlwidget conditional based on the type.

ericduran’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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