diff --git a/www/sites/all/modules/domain/domain.api.php b/www/sites/all/modules/domain/domain.api.php index 3c2c18a..42a11fe 100644 --- a/www/sites/all/modules/domain/domain.api.php +++ b/www/sites/all/modules/domain/domain.api.php @@ -589,19 +589,23 @@ function hook_domain_bootstrap_full($domain) { * Prefix, we only include this function if we know it is necessary. * * @see domain_prefix_init() + * @see hook_url_outbound_alter() * * @param $domain_id * The domain_id taken from {domain}. * @param $path * The internal drupal path to the node. - * @param $path_language - * Language code to look up the path in. + * @param $options + * The path options. * * @ingroup domain_hooks */ -function hook_domainpath($domain_id, &$path, $path_language = '') { +function hook_domainpath($domain_id, &$path, &$options) { // Give a normal path alias $path = drupal_get_path_alias($path); + // In D7, path alias lookups are done after url_alter, so if the + // alias is set, the option must be flagged. + $options['alias'] = TRUE; } /** diff --git a/www/sites/all/modules/domain/domain.module b/www/sites/all/modules/domain/domain.module index 3ac908c..9f732c5 100644 --- a/www/sites/all/modules/domain/domain.module +++ b/www/sites/all/modules/domain/domain.module @@ -2645,16 +2645,15 @@ function domain_warning_check($form_id) { * @return * The $path, modified by reference by hook_domainpath() implementations. */ -function domain_path($domain_id, $path, $path_language = '') { +function domain_path($domain_id, &$path, &$options) { $modules = _domain_path_modules(); if (!empty($modules)) { foreach ($modules as $module) { // Cannot use module_invoke_all() since these are passed by reference. $function = $module . '_domainpath'; - $function($domain_id, $path, $path_language); + $function($domain_id, $path, $options); } } - return $path; } /** diff --git a/www/sites/all/modules/domain/settings_custom_url.inc b/www/sites/all/modules/domain/settings_custom_url.inc index c236798..09c8c14 100644 --- a/www/sites/all/modules/domain/settings_custom_url.inc +++ b/www/sites/all/modules/domain/settings_custom_url.inc @@ -127,13 +127,13 @@ function domain_url_outbound_alter(&$path, &$options, $original_path) { // TODO: merge this code with the above for cleanup. } } - // We may have to Implements hook_domainpath(). + // We may have to refactor this for D7. if (!isset($path_rewrite)) { $path_rewrite = count(_domain_path_modules()); } - // Allow path changes, if needed. + // Allow path changes, if needed. This changed significantly in D7. if ($path_rewrite > 0 && $path != '') { - $path = domain_path($target_domain_id, $original_path, isset($options['language']) ? $options['language']->language : ''); + domain_path($target_domain_id, $path, $options, $original_path); } } }