Commit c5492cc4 authored by deviantintegral's avatar deviantintegral Committed by Dave Reid

Issue #2378467 by deviantintegral, robcolburn: Fixed hook_url_outbound_alter()...

Issue #2378467 by deviantintegral, robcolburn: Fixed hook_url_outbound_alter() is not called when generating the sitemap.
parent edf2d69d
......@@ -32,15 +32,32 @@ function xmlsitemap_get_path_alias($path, $language) {
$last_language = $language;
}
// We need to pass our path through hook_url_outbound_alter(). This fixes
// clean URLs not working when they don't exist in the {url_alias} table and
// are created with something like subpathauto.
$normalized_path = $path;
// hook_url_outbound_alter() expects defaults in url() options.
$options = array(
'fragment' => '',
'query' => array(),
'absolute' => FALSE,
'alias' => FALSE,
'prefix' => '',
);
if ($language != LANGUAGE_NONE && isset($aliases[$language][$path])) {
return $aliases[$language][$path];
$normalized_path = $aliases[$language][$path];
$options['alias'] = TRUE;
}
elseif (isset($aliases[LANGUAGE_NONE][$path])) {
return $aliases[LANGUAGE_NONE][$path];
}
else {
return $path;
$normalized_path = $aliases[LANGUAGE_NONE][$path];
$options['alias'] = TRUE;
}
$original_path = $normalized_path;
drupal_alter('url_outbound', $normalized_path, $options, $original_path);
return $normalized_path;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment