Download & Extend

Add CCK/views formatter to output raw url path

Project:Link
Version:6.x-2.6
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (cannot reproduce)

Issue Summary

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.

AttachmentSize
link.formatter.patch1.29 KB

Comments

#1

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

#2

Here's the reroll against the latest version.

AttachmentSize
link.478922.patch 1.29 KB

#3

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.

#4

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 :)

#5

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?

#6

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.

#7

Status:patch (to be ported)» needs review

#8

You forgot to upload the patch

#9

Doh! Sorry X-)

AttachmentSize
link-n478922-v2.patch 1.47 KB

#10

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.

nobody click here