I am using the "Link" field in Drupal 7 to store links. Sometimes these links are internal and sometimes they are external. In the case of internal links, I would like to be able to store the system URL ("node/371") instead of an alias ("about/mission-statement") so that the link field will auto-correct itself when someone changes the URL alias.
Entity Reference is great for keeping track of internal nodes, but I would like the same field instance to handle both internal and external links.
Advanced Link doesn't seem to do this processing either.
Is there another module I should use, or a hook I can use to intercept the link field processing pre-storage?
I was able to hack the module to get the behavior I wanted by adding two lines of code to
$systemPath = drupal_lookup_path('source',$item['url']); $item['url'] = ($systemPath) ? $systemPath : $item['url'];
… although it would be nice to be able to do this in a way that preserves an upgrade path.