? issue_namespace_71.patch
Index: comment.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/comment.inc,v
retrieving revision 1.131
diff -u -p -r1.131 comment.inc
--- comment.inc	14 Apr 2008 00:28:43 -0000	1.131
+++ comment.inc	7 Aug 2008 15:46:24 -0000
@@ -23,9 +23,9 @@ function project_issue_comment(&$arg, $o
   // This is ugly, but the form workflow doesn't really offer a better
   // choice for this scenario.
   if (isset($_POST['project_info']['pid'])) {
-    $node->pid = $_POST['project_info']['pid'];
+    $node->project_issue['pid'] = $_POST['project_info']['pid'];
   }
-  $project = node_load(array('nid' => $node->pid, 'type' => 'project_project'));
+  $project = node_load(array('nid' => $node->project_issue['pid'], 'type' => 'project_project'));
 
   switch ($op) {
     case 'form':
@@ -170,7 +170,7 @@ function project_issue_comment(&$arg, $o
         }
         // Validate component.
         $component = $arg['project_info']['component'];
-        if ($component && !in_array($component, $project->components)) {
+        if ($component && !in_array($component, $project->project_issue['components'])) {
           $component = 0;
         }
         empty($component) && form_set_error('project_info][component', t('You have to specify a valid component.'));
Index: issue.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/issue.inc,v
retrieving revision 1.313
diff -u -p -r1.313 issue.inc
--- issue.inc	27 May 2008 20:24:26 -0000	1.313
+++ issue.inc	7 Aug 2008 15:46:27 -0000
@@ -22,7 +22,7 @@ function project_issue_page() {
       $project = project_project_retrieve(arg(3));
       // We assume that a user may create issues for projects that he may view.
       if ($project->nid && node_access('view', $project)) {
-        drupal_goto("node/add/project-issue/$project->uri");
+        drupal_goto("node/add/project-issue/". $project->project['uri']);
       }
       else {
         drupal_goto("node/add/project-issue");
@@ -225,7 +225,7 @@ function project_issue_quick_search($url
       drupal_not_found();
       exit;
     }
-    $destination = 'project/issues/'. $project->uri;
+    $destination = 'project/issues/'. $project->project['uri'];
   }
 
   // if 'q' is the only thing in $_GET, and it == destination, don't redirect
@@ -276,7 +276,7 @@ function project_issue_advanced_search($
       drupal_not_found();
       exit;
     }
-    $destination = 'project/issues/'. $project->uri;
+    $destination = 'project/issues/'. $project->project['uri'];
     drupal_goto($destination, drupal_query_string_encode($issue_filters));
   }
 
@@ -608,7 +608,7 @@ function project_issue_pick_project_form
 
 function project_issue_pick_project_form_submit($form_id, $form_values) {
   $project = node_load($form_values['pid']);
-  return 'node/add/project-issue/'. $project->uri;
+  return 'node/add/project-issue/'. $project->project['uri'];
 }
 
 /**
@@ -655,18 +655,18 @@ function project_issue_form($node, $incl
     return;
   }
 
-  if (empty($node->pid)) {
+  if (empty($node->project_issue['pid'])) {
     $pid = arg(3);
     if (!empty($pid)) {
       if (is_numeric($pid)) {
-        $node->pid = db_result(db_query(db_rewrite_sql('SELECT p.nid FROM {project_projects} p WHERE p.nid = %d', 'p'), $pid), 0);
+        $node->project_issue['pid'] = db_result(db_query(db_rewrite_sql('SELECT p.nid FROM {project_projects} p WHERE p.nid = %d', 'p'), $pid), 0);
       }
       else {
-        $node->pid = db_result(db_query(db_rewrite_sql("SELECT p.nid FROM {project_projects} p WHERE p.uri = '%s'", 'p'), $pid), 0);
+        $node->project_issue['pid'] = db_result(db_query(db_rewrite_sql("SELECT p.nid FROM {project_projects} p WHERE p.uri = '%s'", 'p'), $pid), 0);
       }
     }
   }
-  $pid = $node->pid;
+  $pid = $node->project_issue['pid'];
 
   if (empty($pid)) {
     drupal_set_message(t('Invalid project selected.'), 'error');
@@ -692,10 +692,9 @@ function project_issue_form($node, $incl
 
   // Load the project and initialize some support arrays.
   $project = node_load(array('nid' => $pid, 'type' => 'project_project'));
-
   if ($allow_metadata_changes) {
     if (module_exists('project_release') &&
-        $releases = project_release_get_releases($project, 0, 'version', 'all', array($node->rid))) {
+        $releases = project_release_get_releases($project, 0, 'version', 'all', array($node->project_issue['rid']))) {
       $releases = array(t('<none>')) + $releases;
     }
     // Remove releases marked as invalid release nodes for user selection.
@@ -703,16 +702,16 @@ function project_issue_form($node, $incl
       unset($releases[$rid]);
     }
     $components = array();
-    if ($project->components) {
+    if ($project->project_issue['components']) {
       $components = array(t('<none>'));
-      foreach ($project->components as $component) {
+      foreach ($project->project_issue['components'] as $component) {
         $component = check_plain($component);
         $components[$component] = $component;
       }
     }
     $categories = array_merge(array(t('<none>')), project_issue_category(0, 0));
     $priorities = project_issue_priority();
-    $states = project_issue_state(0, true, $node->nid && ($node->uid == $user->uid), $node->sid);
+    $states = project_issue_state(0, true, $node->nid && ($node->uid == $user->uid), $node->project_issue['sid']);
 
     // Setup the array of choices for who the issue is assigned to.
     $assigned = array();
@@ -721,7 +720,7 @@ function project_issue_form($node, $incl
       $function($assigned, $node);
     }
     natcasesort($assigned);
-    $assigned = array(0 => empty($node->assigned) ? t('Unassigned') : t('Unassign')) + $assigned;
+    $assigned = array(0 => empty($node->project_issue['assigned']) ? t('Unassigned') : t('Unassign')) + $assigned;
   }
 
   // Display the site-wide and/or per-project help text.
@@ -733,7 +732,7 @@ function project_issue_form($node, $incl
       '#suffix' => '</div>',
     );
   }
-  $project_help = trim($project->help);
+  $project_help = trim($project->project_issue['help']);
   if (!empty($project_help)) {
     $form['project_help']['project'] = array(
       '#prefix' => '<div class="messages status project">',
@@ -752,7 +751,7 @@ function project_issue_form($node, $incl
     $form['project_info']['pid'] = array(
       '#type' => 'select',
       '#title' => t('Project'),
-      '#default_value' => $node->pid,
+      '#default_value' => $node->project_issue['pid'],
       '#options' => $projects,
       '#required' => TRUE,
     );
@@ -760,7 +759,7 @@ function project_issue_form($node, $incl
       $form['project_info']['rid'] = array(
         '#type' => 'select',
         '#title' => t('Version'),
-        '#default_value' => $node->rid,
+        '#default_value' => $node->project_issue['rid'],
         '#options' => $releases,
         '#required' => TRUE,
       );
@@ -768,7 +767,7 @@ function project_issue_form($node, $incl
     $form['project_info']['component'] = array(
       '#type' => 'select',
       '#title' => t('Component'),
-      '#default_value' => $node->component,
+      '#default_value' => $node->project_issue['component'],
       '#options' => $components,
       '#required' => TRUE,
     );
@@ -781,27 +780,27 @@ function project_issue_form($node, $incl
     $form['issue_info']['category'] = array(
       '#type' => 'select',
       '#title' => t('Category'),
-      '#default_value' => $node->category ? $node->category : arg(4),
+      '#default_value' => $node->project_issue['category'] ? $node->project_issue['category'] : arg(4),
       '#options' => $categories,
       '#required' => TRUE,
     );
     $form['issue_info']['priority'] = array(
       '#type' => 'select',
       '#title' => t('Priority'),
-      '#default_value' => $node->priority ? $node->priority : 2,
+      '#default_value' => $node->project_issue['priority'] ? $node->project_issue['priority'] : 2,
       '#options' => $priorities,
     );
     $form['issue_info']['assigned'] = array(
       '#type' => 'select',
       '#title' => t('Assigned'),
-      '#default_value' => $node->assigned,
+      '#default_value' => $node->project_issue['assigned'],
       '#options' => $assigned,
     );
     if (count($states) > 1) {
       $form['issue_info']['sid'] = array(
         '#type' => 'select',
         '#title' => t('Status'),
-        '#default_value' => $node->sid ? $node->sid : $default_state,
+        '#default_value' => $node->project_issue['sid'] ? $node->project_issue['sid'] : $default_state,
         '#options' => $states,
       );
     }
@@ -845,7 +844,7 @@ function project_issue_form($node, $incl
   $form['issue_details']['format'] = filter_form($node->format);
 
   $directory = file_create_path(variable_get('project_directory_issues', 'issues'));
-  if (!file_check_directory($directory, 0)) {
+  if (!file_check_directory($directory, 1)) {
     $msg = t('File attachments are disabled. The issue directory has not been properly configured.');
     if (user_access('administer site configuration')) {
       $msg .= ' '. t('Please visit the !admin-project-issue-settings page.', array('!admin-project-issue-settings' => l(t('Project issue settings'), 'admin/project/project-issue-settings')));
@@ -883,7 +882,7 @@ function project_issue_validate(&$node) 
           form_set_error('rid', t('You have to specify a valid version.'));
         }
       }
-      if (isset($node->component) && !in_array($node->component, $project->components)) {
+      if (isset($node->component) && !in_array($node->component, $project->project_issue['components'])) {
         $node->component = 0;
       }
       if (empty($node->component)) {
@@ -904,35 +903,36 @@ function project_issue_view($node, $teas
     $node->content['#prefix'] = '<div class="project-issue">';
     $node->content['#suffix'] = '</div>';
 
-    $project = node_load(array('nid' => $node->pid, 'type' => 'project_project'));
-    $release->nid = $node->rid;
+    $project = node_load(array('nid' => $node->project_issue['pid'], 'type' => 'project_project'));
+    $release->nid = $node->project_issue['rid'];
     if (module_exists('project_release')) {
-      $release = project_release_load($release);
+      $data = project_release_load($release);
+      $release = $data['project_release'];
     }
-    $assigned = ($node->assigned && ($account = user_load(array('uid' => $node->assigned))) ? $account->name : t('Unassigned'));
+    $assigned = ($node->project_issue['assigned'] && ($account = user_load(array('uid' => $node->project_issue['assigned']))) ? $account->name : t('Unassigned'));
 
     $current_data = array();
     $current_data['pid'] = array(
       'label' => t('Project'),
       'current' => $project->title,
     );
-    if ($release->version) {
+    if ($release['version']) {
       $current_data['rid'] = array(
         'label' => t('Version'),
-        'current' => $release->version,
+        'current' => $release['version'],
       );
     }
     $current_data['component'] = array(
       'label' => t('Component'),
-      'current' => $node->component,
+      'current' => $node->project_issue['component'],
     );
     $current_data['category'] = array(
       'label' => t('Category'),
-      'current' => project_issue_category($node->category, 0),
+      'current' => project_issue_category($node->project_issue['category'], 0),
     );
     $current_data['priority'] = array(
       'label' => t('Priority'),
-      'current' => project_issue_priority($node->priority),
+      'current' => project_issue_priority($node->project_issue['priority']),
     );
     $current_data['assigned'] = array(
       'label' => t('Assigned'),
@@ -940,7 +940,7 @@ function project_issue_view($node, $teas
     );
     $current_data['sid'] = array(
       'label' => t('Status'),
-      'current' => project_issue_state($node->sid),
+      'current' => project_issue_state($node->project_issue['sid']),
     );
 
     // Allow modules to alter the metadata displayed in the table on the actual
@@ -997,10 +997,10 @@ function project_issue_view($node, $teas
 function project_issue_project_issue_assignees(&$assigned, $node) {
   global $user;
   if ($user->uid) {
-    if (isset($node->assigned) && $user->uid != $node->assigned) {
+    if (isset($node->project_issue['assigned']) && $user->uid != $node->project_issue['assigned']) {
       // Assigned to someone else, add the currently assigned user.
-      $account = user_load(array('uid' => $node->assigned));
-      $assigned[$node->assigned] = $account->name;
+      $account = user_load(array('uid' => $node->project_issue['assigned']));
+      $assigned[$node->project_issue['assigned']] = $account->name;
     }
     // Always let the person replying assign it to themselves.
     $assigned[$user->uid] = $user->name;
@@ -1034,6 +1034,7 @@ function project_issue_project_issue_ass
 function theme_project_issue_summary($current_data, $summary_links) {
   $allowed_tags = array('a', 'em', 'strong');
   $rows = array();
+
   foreach ($current_data as $name => $values) {
     $rows[] = array(filter_xss($values['label'], $allowed_tags) .':', filter_xss($values['current'], $allowed_tags));
   }
@@ -1082,7 +1083,7 @@ function project_issue_internal_links($n
   // Link straight to comment form.
   if ($node->comment == COMMENT_NODE_READ_WRITE && (user_access('post comments') || user_access('post comments without approval'))) {
     // TODO: This conditional needs to be ripped out in D6.
-    $comment_form_location = isset($node->comment_form_location) ? $node->comment_form_location : variable_get('comment_form_location', COMMENT_FORM_SEPARATE_PAGE);
+    $comment_form_location = isset($node->project_issue['comment_form_location']) ? $node->project_issue['comment_form_location'] : variable_get('comment_form_location', COMMENT_FORM_SEPARATE_PAGE);
 
     // Comment form isn't on the page, link to the comment reply page.
     if ($comment_form_location == COMMENT_FORM_SEPARATE_PAGE) {
@@ -1098,12 +1099,12 @@ function project_issue_internal_links($n
 }
 
 function project_issue_load($node) {
-  $project = db_fetch_object(db_query(db_rewrite_sql('SELECT pi.* FROM {project_issues} pi WHERE pi.nid = %d', 'pi'), $node->nid));
+  $project = db_fetch_array(db_query(db_rewrite_sql('SELECT pi.* FROM {project_issues} pi WHERE pi.nid = %d', 'pi'), $node->nid));
 
   // TODO: This need to be ripped out in D6.
-  $project->comment_form_location = variable_get('project_issue_comment_form_location', NULL);
+  $project['comment_form_location'] = variable_get('project_issue_comment_form_location', NULL);
 
-  return $project;
+  return array('project_issue' => $project);
 }
 
 function project_issue_insert($node) {
@@ -1285,7 +1286,7 @@ function project_issue_query($project = 
   if (!empty($project->nid)) {
     drupal_set_title(t('Search issues for %name', array('%name' => $project->title)));
     project_project_set_breadcrumb($project, TRUE);
-    foreach ($project->components as $component) {
+    foreach ($project->project_issue['components'] as $component) {
       $component = check_plain($component);
       $components[$component] = $component;
     }
@@ -1316,7 +1317,7 @@ function project_issue_query($project = 
   $states = project_issue_state();
   $priorities = project_issue_priority();
 
-  $form['#action'] = url(isset($project->uri) ? "project/issues/$project->uri" : 'project/issues');
+  $form['#action'] = url(isset($project->project['uri']) ? "project/issues/". $project->project['uri'] : 'project/issues');
   $form['text'] = array(
     '#type' => 'textfield',
     '#title' => t('Search for'),
@@ -1674,32 +1675,32 @@ function project_issue_query_result($que
     if (node_access('create', 'project_issue')) {
       $links[] = array(
         'title' => t('Create'),
-        'href' => "node/add/project-issue/$project->uri",
-        'attributes' => array('title' => t('Create a new issue for @project.', array('@project' => $project->uri))),
+        'href' => "node/add/project-issue/". $project->project['uri'],
+        'attributes' => array('title' => t('Create a new issue for @project.', array('@project' => $project->project['uri']))),
       );
     }
     else {
       $links[] = array(
-        'title' => theme('project_issue_create_forbidden', $project->uri),
+        'title' => theme('project_issue_create_forbidden', $project->project['uri']),
         'html'  => TRUE,
       );
     }
     $links[] = array(
       'title' => t('Statistics'),
-      'href' => "project/issues/statistics/$project->uri",
-      'attributes' => array('title' => t('See statistics about @project issues.', array('@project' => $project->uri))),
+      'href' => "project/issues/statistics/". $project->project['uri'],
+      'attributes' => array('title' => t('See statistics about @project issues.', array('@project' => $project->project['uri']))),
     );
     if ($user->uid) {
       $links[] = array(
         'title' => t('Subscribe'),
-        'href' => "project/issues/subscribe-mail/$project->uri",
-        'attributes' => array('title' => t('Receive email updates about @project issues.', array('@project' => $project->uri))),
+        'href' => "project/issues/subscribe-mail/". $project->project['uri'],
+        'attributes' => array('title' => t('Receive email updates about @project issues.', array('@project' => $project->project['uri']))),
       );
     }
     $links[] = array(
       'title' => t('Advanced search'),
-      'href' => "project/issues/search/$project->uri",
-      'attributes' => array('title' => t('Use the advanced search page to find @project issues.', array('@project' => $project->uri))),
+      'href' => "project/issues/search/". $project->project['uri'],
+      'attributes' => array('title' => t('Use the advanced search page to find @project issues.', array('@project' => $project->project['uri']))),
     );
   }
   else {
@@ -1718,7 +1719,7 @@ function project_issue_query_result($que
     }
     else {
       $links[] = array(
-        'title' => theme('project_issue_create_forbidden', $project->uri),
+        'title' => theme('project_issue_create_forbidden', $project->project['uri']),
         'html'  => TRUE,
       );
     }
@@ -1793,9 +1794,9 @@ function project_issue_query_result($que
     while ($node = db_fetch_object($result)) {
       $node = node_load($node->nid);
       $row = array();
-      $class = "state-$node->sid";
+      $class = "state-". $node->project_issue['sid'];
       if (!$project->nid) {
-        $row[] = l($projects[$node->pid], "project/issues/$node->pid");
+        $row[] = l($projects[$node->project_issue['pid']], "project/issues/". $node->project_issue['pid']);
       }
       if (strlen($node->title) > 50) {
         $title = l(drupal_substr($node->title, 0, 50), "node/$node->nid", array('title' => $node->title));
@@ -1804,14 +1805,14 @@ function project_issue_query_result($que
         $title = l($node->title, "node/$node->nid");
       }
       $row[] = $title . theme('mark', node_mark($node->nid, $node->changed));
-      $row[] = $states[$node->sid];
-      $row[] = $priorities[$node->priority];
-      $row[] = project_issue_category($node->category, 0);
+      $row[] = $states[$node->project_issue['sid']];
+      $row[] = $priorities[$node->project_issue['priority']];
+      $row[] = project_issue_category($node->project_issue['category'], 0);
       if (count($releases)) {
-        $row[] = $releases[$node->rid];
+        $row[] = $releases[$node->project_issue['rid']];
       }
       $row[] = array('data' => format_interval(time() - $node->changed, 2), 'align' => 'right');
-      $row[] = ($node->assigned) ? theme('username', user_load(array('uid' => $node->assigned))) : '';
+      $row[] = ($node->project_issue['assigned']) ? theme('username', user_load(array('uid' => $node->project_issue['assigned']))) : '';
 
       $row = array('data' => $row, 'class' => $class);
 
@@ -2191,9 +2192,9 @@ function project_issue_change_summary($f
           $release = project_release_load($release);
         }
         else {
-          $release->version = t('Unknown');
+          $release['project_release']['version'] = t('Unknown');
         }
-        return $release->version;
+        return $release['project_release']['version'];
       }
       return t('<none>');
     case 'assigned':
Index: mail.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/mail.inc,v
retrieving revision 1.106
diff -u -p -r1.106 mail.inc
--- mail.inc	20 May 2008 19:26:22 -0000	1.106
+++ mail.inc	7 Aug 2008 15:46:28 -0000
@@ -37,14 +37,15 @@ function project_issue_mailhandler($node
       $entry->teaser = $node->teaser;
       $entry->body = $node->body;
       $entry->uid = $node->uid;
+      $entry->pid = $node->project_issue['pid'];
 
       foreach ($fields as $var => $text) {
         $text = strtolower(str_replace(' ', '_', $text));
-        if (isset($node->$text)) {
-          $node->$text = trim($node->$text);
+        if (isset($node->project_issue[$text])) {
+          $node->$text = trim($node->project_issue[$text]);
           switch ($var) {
             case 'pid':
-              $project = node_load(array('title' => $node->$text, 'type' => 'project_project'));
+              $project = node_load(array('nid' => $node->text, 'type' => 'project_project'));
               if ($project->nid) {
                 $entry->pid = $project->nid;
               }
@@ -76,7 +77,7 @@ function project_issue_mailhandler($node
               break;
             case 'component':
               if ($project->pid || ($entry->pid && ($project = node_load(array('nid' => $entry->pid, 'type' => 'project_project'))))) {
-                if ($project && in_array($node->$text, $project->components)) {
+                if ($project && in_array($node->$text, $project->project_issue['components'])) {
                   $entry->component = $node->$text;
                 }
               }
@@ -182,7 +183,7 @@ function project_mail_notify($nid) {
 
   // There could be stale data in the cached node, so reset the cache.
   $node = node_load($nid, NULL, TRUE);
-  $project = node_load(array('nid' => $node->pid, 'type' => 'project_project'));
+  $project = node_load(array('nid' => $node->project_issue['pid'], 'type' => 'project_project'));
 
   $fields = project_issue_field_labels('email');
 
@@ -204,8 +205,8 @@ function project_mail_notify($nid) {
   if (!empty($node->uid)) {
     $uids[$node->uid] = $node->uid;
   }
-  if (!empty($node->assigned)) {
-    $uids[$node->assigned] = $node->assigned;
+  if (!empty($node->project_issue['assigned'])) {
+    $uids[$node->project_issue['assigned']] = $node->project_issue['assigned'];
   }
 
   // Create complete history of the bug report.
@@ -241,10 +242,10 @@ function project_mail_notify($nid) {
     'Return-Path' => "<$sender->mail>",
     'Date' => date('r'),
     'X-Mailer' => 'Drupal Project module (http://drupal.org/project/project)',
-    'List-Id' => "$project->title <$project->uri-issues-$domain>",
-    'List-Archive' => '<'. url("project/issues/$project->uri", NULL, NULL, 1) .'>',
-    'List-Subscribe' => '<'. url("node/$project->uri", NULL, NULL, 1) .'>',
-    'List-Unsubscribe' => '<'. url("node/$project->uri", NULL, NULL, 1) .'>'
+    'List-Id' => "$project->title <". $project->project['uri'] ."-issues-$domain>",
+    'List-Archive' => '<'. url("project/issues/". $project->project['uri'], NULL, NULL, 1) .'>',
+    'List-Subscribe' => '<'. url("node/". $project->project['uri'], NULL, NULL, 1) .'>',
+    'List-Unsubscribe' => '<'. url("node/". $project->project['uri'], NULL, NULL, 1) .'>'
   );
 
   // Comments exist, set headers accordingly.
@@ -260,11 +261,11 @@ function project_mail_notify($nid) {
 
   if (count($uids)) {
     $placeholders = implode(',', array_fill(0, count($uids), '%d'));
-    array_unshift($uids, $node->pid);
+    array_unshift($uids, $node->project_issue['pid']);
     $result = db_query("SELECT p.*, u.uid, u.name, u.mail FROM {project_subscriptions} p INNER JOIN {users} u ON p.uid = u.uid WHERE u.status = 1 AND p.nid = %d AND (p.level = 2 OR (p.level = 1 AND u.uid IN ($placeholders)))", $uids);
   }
   else {
-    $result = db_query('SELECT p.*, u.uid, u.name, u.mail FROM {project_subscriptions} p INNER JOIN {users} u ON p.uid = u.uid WHERE u.status = 1 AND p.nid = %d AND p.level = 2', $node->pid);
+    $result = db_query('SELECT p.*, u.uid, u.name, u.mail FROM {project_subscriptions} p INNER JOIN {users} u ON p.uid = u.uid WHERE u.status = 1 AND p.nid = %d AND p.level = 2', $node->project_issue['pid']);
   }
 
   // Create link to related node
@@ -278,7 +279,7 @@ function project_mail_notify($nid) {
   $check_file_perms = !db_num_rows(db_query("SELECT rid FROM {permission} WHERE perm LIKE '%view uploaded files%' AND rid IN (%d, %d)", DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID));
 
   project_mail_output($node->title, 0);
-  $subject = t('[!short_name] [!category] !title', array('!short_name' => $project->uri, '!category' => $node->category, '!title' => $node->title));
+  $subject = t('[!short_name] [!category] !title', array('!short_name' => $project->project['uri'], '!category' => $node->project_issue['category'], '!title' => $node->title));
 
   while ($recipient = db_fetch_object($result)) {
     if ($check_file_perms) {
@@ -292,17 +293,17 @@ function project_mail_notify($nid) {
     drupal_mail('project_issue_update', $recipient->mail, $subject, $body, $from, $header);
   }
 
-  if (is_array($project->mail_copy_filter) && count(array_filter($project->mail_copy_filter)) && !$project->mail_copy_filter[$node->category]) {
+  if (is_array($project->project_issue['mail_copy_filter']) && count(array_filter($project->project_issue['mail_copy_filter'])) && !$project->project_issue['mail_copy_filter'][$node->project_issue['category']]) {
     return;
   }
 
-  if (is_array($project->mail_copy_filter_state) && count(array_filter($project->mail_copy_filter_state)) && !$project->mail_copy_filter_state[$node->sid]) {
+  if (is_array($project->project_issue['mail_copy_filter_state']) && count(array_filter($project->project_issue['mail_copy_filter_state'])) && !$project->project_issue['mail_copy_filter_state'][$node->project_issue['sid']]) {
     return;
   }
 
-  if ($project->mail_copy) {
+  if ($project->project_issue['mail_copy']) {
     $body = "$links\n". project_mail_generate_followup_mail_body($node, $history, TRUE);
-    drupal_mail('project_issue_update', $project->mail_copy, $subject, $body, $from, $header);
+    drupal_mail('project_issue_update', $project->project_issue['mail_copy'], $subject, $body, $from, $header);
   }
 }
 
Index: project_issue.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/project_issue.module,v
retrieving revision 1.94
diff -u -p -r1.94 project_issue.module
--- project_issue.module	28 Jul 2008 20:54:49 -0000	1.94
+++ project_issue.module	7 Aug 2008 15:46:30 -0000
@@ -589,8 +589,8 @@ function project_issue_project_edit_issu
   project_project_set_breadcrumb($node);
   drupal_set_title(check_plain($node->title));
 
-  if (isset($node->components) && is_array($node->components)) {
-    $node->components = implode("\n", $node->components);
+  if (isset($node->project_issue['components']) && is_array($node->project_issue['components'])) {
+    $node->project_issue['components'] = implode("\n", $node->project_issue['components']);
   }
   return drupal_get_form('project_issue_project_edit_form', $node);
 }
@@ -613,20 +613,20 @@ function project_issue_project_edit_form
     '#type' => 'checkbox',
     '#title' => t('Enable issue tracker'),
     '#return_value' => 1,
-    '#default_value' => isset($node->issues) ? $node->issues : 1,
+    '#default_value' => isset($node->project_issue['issues']) ? $node->project_issue['issues'] : 1,
     '#description' => t('Let users submit bug requests, patches, feature requests, support requests, etc.'),
   );
   $form['issue']['components'] = array(
     '#type' => 'textarea',
     '#title' => t('Components'),
-    '#default_value' => isset($node->components) ? $node->components : NULL,
+    '#default_value' => isset($node->project_issue['components']) ? $node->project_issue['components'] : NULL,
     '#cols' => 20,
     '#rows' => 5,
   );
   $form['issue']['help'] = array(
     '#type' => 'textarea',
     '#title' => t('Submission guidelines'),
-    '#default_value' => isset($node->help) ? $node->help : NULL,
+    '#default_value' => isset($node->project_issue['help']) ? $node->project_issue['help'] : NULL,
     '#cols' => 20,
     '#rows' => 5,
   );
@@ -640,7 +640,7 @@ function project_issue_project_edit_form
   $form['email']['mail_digest'] = array(
     '#type' => 'textfield',
     '#title' => t('Weekly critical issues report'),
-    '#default_value' => isset($node->mail_digest) ? $node->mail_digest : NULL,
+    '#default_value' => isset($node->project_issue['mail_digest']) ? $node->project_issue['mail_digest'] : NULL,
     '#size' => 20,
     '#maxlength' => 255,
     '#description' => t('To get a weekly digest of critical issues specify an e-mail address.'),
@@ -648,7 +648,7 @@ function project_issue_project_edit_form
   $form['email']['mail_copy'] = array(
     '#type' => 'textfield',
     '#title' => t('Issues e-mail address'),
-    '#default_value' => isset($node->mail_copy) ? $node->mail_copy : NULL,
+    '#default_value' => isset($node->project_issue['mail_copy']) ? $node->project_issue['mail_copy'] : NULL,
     '#size' => 20,
     '#maxlength' => 255,
     '#description' => t('If you wish to receive a copy of all the issues to a central location specify an address here. <em>Note: the copy will contain links to file attachments.</em>'),
@@ -666,7 +666,7 @@ function project_issue_project_edit_form
       '#type' => 'checkbox',
       '#title' => $choice,
       '#return_value' => $key,
-      '#default_value' => isset($node->mail_copy_filter[$key]) ? $node->mail_copy_filter[$key] : NULL,
+      '#default_value' => isset($node->project_issue['mail_copy_filter'][$key]) ? $node->project_issue['mail_copy_filter'][$key] : NULL,
     );
   }
   $options = project_issue_state();
@@ -681,7 +681,7 @@ function project_issue_project_edit_form
       '#type' => 'checkbox',
       '#title' => $choice,
       '#return_value' => $key,
-      '#default_value' => isset($node->mail_copy_filter_state[$key]) ? $node->mail_copy_filter_state[$key] : NULL,
+      '#default_value' => isset($node->project_issue['mail_copy_filter_state'][$key]) ? $node->project_issue['mail_copy_filter_state'][$key] : NULL,
     );
   }
 
@@ -694,7 +694,7 @@ function project_issue_project_edit_form
       '#type' => 'checkbox',
       '#title' => t('Send monthly reminders to users'),
       '#return_value' => 1,
-      '#default_value' => isset($node->mail_reminder) ? $node->mail_reminder : NULL,
+      '#default_value' => isset($node->project_issue['mail_reminder']) ? $node->project_issue['mail_reminder'] : NULL,
       '#description' => t('Enabling this will send a monthly reminder to users that have open issues registered.'),
     );
   }
@@ -882,8 +882,8 @@ function project_issue_user_page($arg = 
   while ($node = db_fetch_object($result)) {
     $node_obj = node_load($node->nid);
     $node->is_admin = node_access('update', $node_obj);
-    $node->issues = $node_obj->issues;
-    $node->releases = isset($node_obj->releases) ? $node_obj->releases : 0;
+    $node->project_issue['issues'] = $node_obj->issues;
+    $node->project_release['releases'] = isset($node_obj->project_release['releases']) ? $node_obj->project_release['releases'] : 0;
     if ($node->is_admin) {
       $any_admin = TRUE;
     }
@@ -1008,12 +1008,13 @@ function project_issue_project_load(&$no
   if (!$project) {
     return $node;
   }
+  $node->project_issue = array();
   //assert($project);
-  $node->components = unserialize($project->components);
-  $node->mail_copy_filter = unserialize($project->mail_copy_filter);
-  $node->mail_copy_filter_state = unserialize($project->mail_copy_filter_state);
+  $node->project_issue['components'] = unserialize($project->components);
+  $node->project_issue['mail_copy_filter'] = unserialize($project->mail_copy_filter);
+  $node->project_issue['mail_copy_filter_state'] = unserialize($project->mail_copy_filter_state);
   foreach (array('issues', 'help', 'mail_digest', 'mail_copy', 'mail_reminder') as $field) {
-    $node->$field = $project->$field;
+    $node->project_issue[$field] = $project->$field;
   }
   return $node;
 }
@@ -1044,7 +1045,7 @@ function project_issue_project_delete($n
  */
 function project_issue_check_directory($form_element) {
   $directory = file_create_path($form_element['#value']);
-  file_check_directory($directory, FILE_CREATE_DIRECTORY, $form_element['#parents'][0]);
+  file_check_directory($directory, FILE_CREATE_DIRECTORY, $form_element['#parents'][0], 1);
   return $form_element;
 }
 
@@ -1075,7 +1076,7 @@ function project_issue_comment_mass_upda
 function project_issue_set_breadcrumb($node, $project) {
   $extra = array();
   $extra[] = l($project->title, 'node/'. $project->nid);
-  $extra[] = l(t('Issues'), 'project/issues/'. $project->uri);
+  $extra[] = l(t('Issues'), 'project/issues/'. $project->project['uri']);
   // Add the issue title if we're on a comment reply page.
   if (project_issue_is_comment_reply()) {
     $extra[] = l($node->title, 'node/'. $node->nid);
@@ -1135,7 +1136,7 @@ function project_issue_views_default_vie
  */
 function theme_project_issue_issue_link($node, $comment_id = NULL, $comment_number = NULL) {
   $path = "node/$node->nid";
-  $attributes = array('title' => project_issue_state($node->sid));
+  $attributes = array('title' => project_issue_state($node->project_issue['sid']));
   if ($comment_id) {
     $title = "#$node->nid-$comment_number: $node->title";
     $link = l($title, $path, $attributes, NULL, "comment-$comment_id");
@@ -1144,7 +1145,7 @@ function theme_project_issue_issue_link(
     $title = "#$node->nid: $node->title";
     $link = l($title, $path, $attributes);
   }
-  $output = "<span class=\"project-issue-status-$node->sid\">$link</span>";
+  $output = "<span class=\"project-issue-status-". $node->project_issue['sid'] ."\">$link</span>";
   return $output;
 }
 
