It is possible that the hook_url_alter() patch is not needed.

Investigate using http://api.drupal.org/api/function/custom_url_rewrite/5 instead.

Comments

agentrickard’s picture

Status: Active » Postponed

In Drupal 5, it appears that the patch is necessary, since custom_url_rewrite() can only modify the $path element, which results in URLs such as: http://one.example.com/?q=http%3A//example.com/node/3, which is not the desired behavior.

It does appear that custom_url_rewrite_outbound() in Drupal 6 will allow for this feature, since that function takes all the arguments from url(),

http://api.drupal.org/api/function/custom_url_rewrite_outbound/6

agentrickard’s picture

Status: Postponed » Active

Perhaps instead of the hook_url_alter() patch, we should backport custom_url_rewrite_outbound?

agentrickard’s picture

Not without patching that function. custom_url_rewrite_outbound() does not allow us to change the absolute path of the url because it is invoked too late in the url() function.

See http://drupal.org/node/207330

agentrickard’s picture

To change this function, we would remove the hook_url_alter() patch, and replace it with this code in url():

  // Preserve the original path before aliasing.
  $original_path = $path;
  if (function_exists('custom_url_rewrite_outbound')) {
    // Modules may alter outbound links by reference.
    custom_url_rewrite_outbound($path, $query, $fragment, $absolute, $original_path);
  } 

And then move the existing domain_url_alter() function to custom_url_rewrite_outbound().

agentrickard’s picture

Version: 5.x-1.0rc3 » 5.x-1.0rc4

Now that this patch is in Drupal 6, I will simply backport this for Drupal 5.

agentrickard’s picture

Priority: Normal » Critical
Status: Active » Fixed

Committed to HEAD.

This changes the INSTALL procedure for the module, but brings Domain in line with Drupal 6 core.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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