Index: project_issue.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/project_issue.module,v
retrieving revision 1.67
diff -u -F^f -r1.67 project_issue.module
--- project_issue.module	31 Oct 2007 18:53:16 -0000	1.67
+++ project_issue.module	3 Nov 2007 13:28:46 -0000
@@ -8,11 +8,13 @@
 /// How many issues should be displayed per page by default.
 define('PROJECT_ISSUES_PER_PAGE', 20);
 
-$path = drupal_get_path('module', 'project_issue');
-if (file_exists("$path/issue.inc")) {
-  require_once "$path/issue.inc";
-  require_once "$path/comment.inc";
-  require_once "$path/mail.inc";
+if (function_exists('drupal_get_path')) {
+  $path = drupal_get_path('module', 'project_issue');
+  if (file_exists("$path/issue.inc")) {
+    require_once "$path/issue.inc";
+    require_once "$path/comment.inc";
+    require_once "$path/mail.inc";
+  }
 }
 
 function project_issue_help($section) {
@@ -614,8 +616,13 @@ function project_issue_exit() {
   // hook_exit() so that all issue and file data is in a consistent state
   // before we generate the email.
   $nids = project_issue_set_mail_notify();
-  foreach ($nids as $nid) {
-    project_mail_notify($nid);
+  // For cached pages, this hook is called, but there aren't any mail functions
+  // loaded. Since the cached pages won't have any new mail notifications,
+  // we can safely test for this case.
+  if (!empty($nids)) {
+    foreach ($nids as $nid) {
+      project_mail_notify($nid);
+    }
   }
 }
 
