In order to use this field type in views to link other fields (using the very handy 'output this field as a link' feature), it is necessary to have a formatter that returns the raw path/url, rather than running it through the url function. (Without this formatter, the links are run through the url function twice, which results in absolute links for the form:

http://my/local/path

instead of

http://{drupal}/my/local/path

The attached patch adds this formatter.

Comments

jesss’s picture

I'd like to test this. Can you reroll the patch against the latest version (6.x-2.6)?

jhedstrom’s picture

StatusFileSize
new1.29 KB

Here's the reroll against the latest version.

jesss’s picture

When I tried to apply the patch, all three hunks failed. It's entirely possible that this is user-error on my part -- I'm a complete novice to the patch process.

That said, when I made the changes to link.module manually, the code changes worked like a perfectly.

joachim’s picture

Patch applies cleanly with the latest release:
@jess -- do:
$ patch -p0 < link.478922.patch

Will report back once I've actually tried it on a site :)

joachim’s picture

Confirming this works.

You still need to run the data through link_cleanup_url(), in case users have entered "google.com" without a protocol. I'm doing this in my views template, but perhaps it would be nice to do this cleanup automatically? Would there be cases where that is not needed?

damienmckenna’s picture

Version: 6.x-2.6-beta1 » 6.x-2.6
Status: Needs review » Patch (to be ported)

Here's a rerolled patch that includes a quick call on link_cleanup_url() before returning the link.

damienmckenna’s picture

Status: Patch (to be ported) » Needs review
crea’s picture

You forgot to upload the patch

damienmckenna’s picture

StatusFileSize
new1.47 KB

Doh! Sorry X-)

dqd’s picture

Status: Needs review » Closed (cannot reproduce)

I close this issue since it is too old to reproduce or commit. If this feature is still missing please start a new issue for that. thanks for the effort and for understanding.