? 529026-outbound-doc.patch ? 529026-outbound.patch ? 529026.patch Index: INSTALL.txt =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/domain/INSTALL.txt,v retrieving revision 1.22 diff -u -p -r1.22 INSTALL.txt --- INSTALL.txt 14 Jun 2009 19:27:59 -0000 1.22 +++ INSTALL.txt 26 Jul 2009 18:09:07 -0000 @@ -408,41 +408,22 @@ into your settings.php file. custom_url_rewrite_outbound() is a special function that you can add to settings.php to alter how Drupal writes links to content. -Domain Access implements this function inside its settings.inc file. +Domain Access implements this function within the context of the +URL Alter module, http://drupal.org/project/url_alter, which is a +functional backport of changes implemented in Drupal 7. -If your site already uses this function -- it is not in core -- then you will -need to modify its use to accommodate Domain Access because the -module has its own version. - -Domain Access loads its version of this function automatically if -it does not already exist. If it does exist, you need to decide which -version should run first, and then add something like the following -code to settings.php _below_ the lines from step 4.4: - -==== -/** - * Both Drupal for Facebook and domain module use the - * custom_url_rewrite feature. We have to define our own functions - * which call the others in the proper order. - */ -function custom_url_rewrite_outbound(&$path, &$options, $original_path) { - // Call fb module first - if (function_exists('fb_settings_url_rewrite_outbound')) { - fb_settings_url_rewrite_outbound($path, $options, $original_path); - } - if (function_exists('domain_url_rewrite_outbound')) { - domain_url_rewrite_outbound($path, $options, $original_path); - } -} -==== +If your site uses custom code to implement custom_url_rewrite_outbound(), +consider upgrading to the URL Alter module for full compatibility. -You may need to experiment with the order in which you call these functions. +You may also call the function domain_url_rewrite_outbound() directly in +your custom code. NOTE: Domain Access does not use custom_url_rewrite_inbound(). For more information, see http://api.drupal.org/api/function/custom_url_rewrite_outbound/6 http://drupal.org/node/450344 + http://drupal.org/node/529026 ---- 5. Additional Module Installation Index: INSTALL_QUICKSTART.txt =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/domain/INSTALL_QUICKSTART.txt,v retrieving revision 1.7 diff -u -p -r1.7 INSTALL_QUICKSTART.txt --- INSTALL_QUICKSTART.txt 24 May 2009 22:52:28 -0000 1.7 +++ INSTALL_QUICKSTART.txt 26 Jul 2009 18:09:07 -0000 @@ -46,30 +46,19 @@ include './sites/all/modules/domain/sett you will need to modify its use to accommodate Domain Access because the module has its own version. - Domain Access loads its version of this function automatically if - it does not already exist. If it does exist, you need to decide which - version should run first, and then add something like the following - code to settings.php _below_ the lines from step 3: - -/** - * Both Drupal for Facebook and domain module use the - * custom_url_rewrite feature. We have to define our own functions - * which call the others in the proper order. - */ -function custom_url_rewrite_outbound(&$path, &$options, $original_path) { - // Call fb module first - if (function_exists('fb_settings_url_rewrite_outbound')) { - fb_settings_url_rewrite_outbound($path, $options, $original_path); - } - if (function_exists('domain_url_rewrite_outbound')) { - domain_url_rewrite_outbound($path, $options, $original_path); - } -} + Domain Access implements this function within the context of the + URL Alter module, http://drupal.org/project/url_alter, which is a + functional backport of changes implemented in Drupal 7. - NOTE: Domain Access does not use custom_url_rewrite_inbound(). + If your site uses custom code to implement custom_url_rewrite_outbound(), + consider upgrading to the URL Alter module for full compatibility. + + You may also call the function domain_url_rewrite_outbound() directly in + your custom code. + NOTE: Domain Access does not use custom_url_rewrite_inbound(). -5. Go to Admin > Build > Modules. Therre you will see the Domain +5. Go to Admin > Build > Modules. There you will see the Domain module group. Only enable the Domain Acccess module. Index: domain.bootstrap.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain.bootstrap.inc,v retrieving revision 1.9 diff -u -p -r1.9 domain.bootstrap.inc --- domain.bootstrap.inc 28 Jun 2009 15:23:20 -0000 1.9 +++ domain.bootstrap.inc 26 Jul 2009 18:09:08 -0000 @@ -59,10 +59,6 @@ function domain_bootstrap() { break; } } - if (!isset($_domain['error'])) { - // All the load phases worked, so load custom_url_rewrite_outbound(). - include 'settings_custom_url.inc'; - } } /** @@ -89,8 +85,8 @@ function _domain_bootstrap($phase) { // Load bootstrap modules registered by Domain Access. _domain_bootstrap_modules_load(); - // if essential core module file has not been loaded, bootstrap fails. + // If essential core module file has not been loaded, bootstrap fails. if (!function_exists('domain_load')) { return FALSE; } Index: domain.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain.module,v retrieving revision 1.114 diff -u -p -r1.114 domain.module --- domain.module 28 Jun 2009 15:42:04 -0000 1.114 +++ domain.module 26 Jul 2009 18:09:10 -0000 @@ -94,6 +94,10 @@ function domain_init() { } // Set the site name to the domain-specific name. $conf['site_name'] = $_domain['sitename']; + + // Properly load custom_url_rewrite_outbound(). + // See http://drupal.org/node/529026 + include_once(drupal_get_path('module', 'domain') .'/settings_custom_url.inc'); } /** Index: settings_custom_url.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/domain/settings_custom_url.inc,v retrieving revision 1.21 diff -u -p -r1.21 settings_custom_url.inc --- settings_custom_url.inc 31 May 2009 18:16:40 -0000 1.21 +++ settings_custom_url.inc 26 Jul 2009 18:09:10 -0000 @@ -11,18 +11,27 @@ */ /** - * Implement custom_url_rewrite_outbound(). + * Implement custom_url_rewrite_outbound() if the url_alter.module is not enabled. */ if (!function_exists('custom_url_rewrite_outbound')) { function custom_url_rewrite_outbound(&$path, &$options, $original_path) { - domain_url_rewrite_outbound($path, $options, $original_path); + domain_url_alter_outbound($path, $options, $original_path); } } /** - * Forces absolute paths for domains when needed. + * Legacy wrapper for users of 6.x.2, rc8. */ function domain_url_rewrite_outbound(&$path, &$options, $original_path) { + domain_url_alter_outbound($path, $options, $original_path); +} + +/** + * Implementation of hook_url_alter_outbound(). + * + * Forces absolute paths for domains when needed. + */ +function domain_url_alter_outbound(&$path, &$options, $original_path) { global $_domain; // If the domain_id is not set, then the Domain module is not active, and we cannot run this function.