It is already fixed in Drupal as it lives as hook_url_outbound_alter() now, as well as replacing taxonomy_term_path and hook_term_path().<br><br>As I explained in the issue that MT posted, the only way to fix this in D5 or D6 is to patch common.inc to move the custom_url_rewrite_outbound up in the execution of ulr(), before the url alias lookups and the return line for external links. However, I doubt this change would ever be approved since it's basically an API change because of when the function is called. This would be like changing hook_nodeapi('update') to be called before a node is updated instead of afterwards.<br>
<br>We just probably have to live with the fact that this was a poorly implemented feature, and at least look forward to things happening correctly now with D7+.<br><br clear="all">Dave Reid<br><a href="mailto:dave@davereid.net">dave@davereid.net</a><br>
<br><br><div class="gmail_quote">On Mon, Nov 9, 2009 at 4:56 PM, Ken Rickard <span dir="ltr"><<a href="mailto:agentrickard@gmail.com">agentrickard@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I think you may need a patch. We had something similar come up in<br>
Drupal 5, and obviously missed this use-case when we had the call to<br>
custom_url_rewrite_outbound() inserted in the url() function.<br>
<br>
The D5 version of Domain Access shipped with a functional backport of<br>
the patch, so best practice suggests fixing this against Drupal 8 (or<br>
7 if we can call it an API bug) and then backport the patch to D6.<br>
<br>
/me will vote that this is a bug in the API.<br>
<br>
- Ken Rickard<br>
agentrickard<br>
<div><div></div><div class="h5"><br>
<br>
On Mon, Nov 9, 2009 at 11:25 PM, Mlen-Too Wesley<br>
<<a href="mailto:mlen.too.wesley@gmail.com">mlen.too.wesley@gmail.com</a>> wrote:<br>
> Hello,<br>
><br>
> I am currently developing a module to help libraries rewrite links to<br>
> external databases, such as ProQuest and LexisNexis, routing those links<br>
> through an EZProxy or other proxy referral server.<br>
><br>
> For example, consider a resource located at:<br>
> <a href="http://www.books24x7.com/marc.asp?bookid=30164" target="_blank">http://www.books24x7.com/marc.asp?bookid=30164</a><br>
><br>
> If accessed from an on-campus IP address, the resource will be available to<br>
> the student. However, if off-campus, the student would either have to use<br>
> VPN to route all their internet traffic through a university IP address or<br>
> use an proxy referral server, such as EZProxy.<br>
><br>
> EZProxy is easier, so from the library home page, the link is rewritten to<br>
> something such as:<br>
> <a href="http://ezproxy.example-library.edu/login?url=http://www.books24x7.com/marc.asp?bookid=30164" target="_blank">http://ezproxy.example-library.edu/login?url=http://www.books24x7.com/marc.asp?bookid=30164</a><br>
><br>
> This way, the student is presented with a login screen for authentication<br>
> and then directed to the resource.<br>
><br>
> An easy module to make... or so I thought. Given the<br>
> custom_url_rewrite_outbound() function, this kind of stuff should be easy to<br>
> do in Drupal, but it is not. The url() function in common.inc returns the<br>
> $path variable without any attempts to call custom_url_rewrite_outbout().<br>
><br>
> All would be well, if line 1408 of common.inc added the same functionality<br>
> to external links in the url() function as it does for internal links. It<br>
> just needs 3 lines:<br>
><br>
> if (function_exists('custom_url_rewrite_outbound')) {<br>
> // Modules may alter outbound links by reference.<br>
> custom_url_rewrite_outbound($path, $options, $original_path);<br>
> }<br>
><br>
> Other than applying a patch, does anyone know another way around this issue?<br>
><br>
> I am not talking about Apache mod_rewrite or anything similar, Clean URLs,<br>
> or the Path module and URL aliases. I am looking for a way to rewrite<br>
> external URLs in anchor tags (links) without creating a wrapper function for<br>
> url() or l()... or using JavaScript or AJAX.<br>
><br>
> Thanks!<br>
><br>
> MT<br>
><br>
><br>
><br>
><br>
><br>
><br>
<br>
<br>
<br>
</div></div><font color="#888888">--<br>
Ken Rickard<br>
<a href="mailto:agentrickard@gmail.com">agentrickard@gmail.com</a><br>
<a href="http://ken.therickards.com" target="_blank">http://ken.therickards.com</a><br>
</font></blockquote></div><br>