Index: url_alter.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/url_alter/url_alter.install,v
retrieving revision 1.1.2.6
diff -u -p -r1.1.2.6 url_alter.install
--- url_alter.install	1 Nov 2009 21:52:19 -0000	1.1.2.6
+++ url_alter.install	19 Apr 2010 16:27:40 -0000
@@ -31,19 +31,43 @@ function url_alter_requirements($phase) 
   $requirements = array();
   $t = get_t();
 
-  drupal_load('module', 'url_alter');
+  // Don't load try to load the module during installation.
+  if (!defined('MAINTENANCE_MODE') && constant('MAINTENANCE_MODE') != 'install') {
+    drupal_load('module', 'url_alter');
+  }
+  
   foreach (array('custom_url_rewrite_inbound', 'custom_url_rewrite_outbound') as $function) {
     $requirement = array('title' => $t('URL alter'));
-    if (defined('URL_ALTER_' . strtoupper($function))) {
-      $requirement['value'] = $t('Overriding @function() successfully.', array('@function' => $function));
+
+    // This is during an installation profile, cannot use the module's
+    // internal functions.
+    if (defined('MAINTENANCE_MODE') && constant('MAINTENANCE_MODE') == 'install') {
+      // Can't do a full checkon the ability to override the function, so
+      // just do a simple check to see if it already exists.
+      if (function_exists('custom_url_rewrite_inbound') || function_exists('custom_url_rewrite_outbound')) {
+        $requirement['value'] = $t('Cannot override @function().', array('@function' => $function));
+        $requirement['severity'] = REQUIREMENT_ERROR;
+        $requirement['description'] = $t("URL alter cannot override the function @function() because it is already defined (!location). Please comment out or remove the existing function and copy the function's body code into the <a href=\"@url-alter\">URL alter module's settings</a>.", array('@function' => $function, '!location' => $info->location ? $info->location : t("usually located in your site's settings.php file"), '@url-alter' => url('admin/settings/url-alter')));
+      }
+      // Should be fine.
+      else {
+        $requirement['value'] = $t('Should be ok to override @function().', array('@function' => $function));
+      }
     }
-    elseif (!url_alter_is_disabled()) {
-      $requirement['value'] = $t('Cannot override @function().', array('@function' => $function));
-      $requirement['severity'] = REQUIREMENT_ERROR;
-      $info = url_alter_get_function_info($function);
-      $requirement['description'] = $t("URL alter cannot override the function @function() because it is already defined (!location). Please comment out or remove the existing function and copy the function's body code into the <a href=\"@url-alter\">URL alter module's settings</a>.", array('@function' => $function, '!location' => $info->location ? $info->location : t("usually located in your site's settings.php file"), '@url-alter' => url('admin/settings/url-alter')));
+
+    // During normal usage
+    else {
+      if (defined('URL_ALTER_' . strtoupper($function))) {
+        $requirement['value'] = $t('Overriding @function() successfully.', array('@function' => $function));
+      }
+      elseif (!url_alter_is_disabled()) {
+        $info = url_alter_get_function_info($function);
+        $requirement['value'] = $t('Cannot override @function().', array('@function' => $function));
+        $requirement['severity'] = REQUIREMENT_ERROR;
+        $requirement['description'] = $t("URL alter cannot override the function @function() because it is already defined (!location). Please comment out or remove the existing function and copy the function's body code into the <a href=\"@url-alter\">URL alter module's settings</a>.", array('@function' => $function, '!location' => $info->location ? $info->location : t("usually located in your site's settings.php file"), '@url-alter' => url('admin/settings/url-alter')));
+      }
+      $requirements['url_alter_' . $function] = $requirement;
     }
-    $requirements['url_alter_' . $function] = $requirement;
   }
 
   return $requirements;
