Index: pift.cron.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_test/pift.cron.inc,v
retrieving revision 1.47
diff -u -r1.47 pift.cron.inc
--- pift.cron.inc	5 Jan 2010 23:35:07 -0000	1.47
+++ pift.cron.inc	6 Jan 2010 03:02:22 -0000
@@ -17,7 +17,7 @@
     return;
   }
 
-  $api_versions = array_filter(variable_get('pift_core', array()));
+  $api_versions = pift_core_api_versions();
   $sids = variable_get('pift_status', array());
 
   // Only attempt query if both values are not empty.
@@ -247,13 +247,15 @@
  * @param array $projects List of required projects (pids).
  */
 function pift_cron_queue_batch_build_branches_process(array &$batch, array &$branches, array &$projects) {
-  // Relase API version vocabulary.
-  $api_vid = _project_release_get_api_vid();
+  $api_versions = pift_core_versions();
 
   // Include branch data for all dependency branches and those that require review.
   foreach ($branches as $rid => $test) {
     // Load branch release node.
-    $branch = node_load($rid);
+    if (!($branch = node_load($rid))) {
+      watchdog('pift', 'Invalid release ID [' . $rid . '] for test ID [' . $test['test_id'] . '].', WATCHDOG_ERROR);
+      continue;
+    }
 
     // Generate branch information.
     $item = array(
@@ -267,22 +269,29 @@
     );
 
     // Attempt to determine the Drupal core API version.
-    list($api_version, $api_tid) = pift_core_api($branch);
+    $api = array();
+    foreach ($node->taxonomy as $tid => $term) {
+      if (in_array($tid, $api_versions)) {
+        $api['version'] = array_shift(explode('.', $term->name, 2));
+        $api['tid'] = $term->tid;
+        break;
+      }
+    }
 
     // If the API version not found then ignore this branch.
-    if (empty($api_version)) {
-      watchdog('pift', 'Project release node [@nid] must have a Drupal core API taxonomy term.', array('@nid' => $branch->nid));
+    if (empty($api)) {
+      watchdog('pift', 'Project release node [@nid] does not have a Drupal core API taxonomy term.', array('@nid' => $branch->nid), WATCHDOG_ERROR);
       continue;
     }
 
     // If the project is Drupal core then add the plugin argument, otherwise
     // determine the compatible core branch and add it as a dependency.
     if (PIFT_PID == $item['project_identifier']) {
-      $item['plugin_argument']['core'] = $api_version;
+      $item['plugin_argument']['core'] = $api['version'];
     }
     else {
       // Load the Drupal core API release (branch) compatible with this branch.
-      $api_release = node_load(pift_core_api_release($api_tid));
+      $api_release = node_load(pift_core_api_release($api['tid']));
       $item['dependency'] = $api_release->nid;
       $item['plugin_argument']['modules'] = array(); // TODO Include the list of modules.
 
Index: pift.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_test/pift.install,v
retrieving revision 1.20
diff -u -r1.20 pift.install
--- pift.install	13 Nov 2009 02:41:25 -0000	1.20
+++ pift.install	6 Jan 2010 03:02:22 -0000
@@ -260,3 +260,12 @@
 
   return $ret;
 }
+
+/**
+ * Convert the core API versions variable to term IDs and enable 6.x and 7.x.
+ */
+function pift_update_6203() {
+  variable_set('pift_core', array(87 => 87, 103 => 103));
+
+  return array();
+}
Index: pift.test.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_test/pift.test.inc,v
retrieving revision 1.20
diff -u -r1.20 pift.test.inc
--- pift.test.inc	3 Nov 2009 21:47:11 -0000	1.20
+++ pift.test.inc	6 Jan 2010 03:02:22 -0000
@@ -107,21 +107,25 @@
 /**
  * Check the criteria for the specified issue.
  *
+ * The checks are in order of expensive.
+ *
  * @param object $node Node object.
  * @return boolean Passed criteria.
  */
 function pift_test_check_criteria_issue($node) {
-  if (!pift_project_enabled($node->project_issue['pid'])) {
+  // Ensure that the issue is in one of the acceptable statuses.
+  if (!in_array($node->project_issue['sid'], variable_get('pift_status', array()))) {
     return FALSE;
   }
 
-  $release = node_load($node->project_issue['rid']);
-  list($api_version, $api_tid) = pift_core_api($release);
-  if (!in_array($api_version, array_filter(variable_get('pift_core', array())))) {
+  // Ensure that the project has testing enabled.
+  if (!pift_project_enabled($node->project_issue['pid'])) {
     return FALSE;
   }
 
-  if (!in_array($node->project_issue['sid'], variable_get('pift_status', array()))) {
+  // Ensure that one of the compatibility terms is present on the release node.
+  $release = node_load($node->project_issue['rid']);
+  if (!in_array(pift_core_api_versions(), array_keys($release->taxonomy)) {
     return FALSE;
   }
 
Index: pift.pages.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_test/pift.pages.inc,v
retrieving revision 1.30
diff -u -r1.30 pift.pages.inc
--- pift.pages.inc	5 Jan 2010 23:18:01 -0000	1.30
+++ pift.pages.inc	6 Jan 2010 03:02:22 -0000
@@ -45,12 +45,19 @@
     '#weight' => -9,
     '#access' => user_access('pift enable project testing'),
   );
-  $versions = array_filter(variable_get('pift_core', array()));
+
+  // Build an array of core capatible version strings (ie 6.x, 7.x, etc).
+  $api_versions = pift_core_api_versions();
+  $versions = array();
+  foreach ($api_versions as $api_version) {
+    $term = taxonomy_get_term($api_version);
+    $versions[] = $term->name;
+  }
   $form['testing']['pift_enable'] = array(
     '#type' => 'checkbox',
     '#title' => t('Enable automated testing'),
     '#description' => t('Enable automated testing of @versions compatible branches and patches.',
-      array('@versions' => implode('.x, ', $versions) . '.x')),
+      array('@versions' => implode(', ', $versions))),
     '#default_value' => pift_project_enabled($form['nid']['#value']),
   );
   $form['#submit'][] = 'pift_pages_project_issue_settings_submit';
Index: pift.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_test/pift.module,v
retrieving revision 1.38
diff -u -r1.38 pift.module
--- pift.module	6 Jan 2010 02:10:44 -0000	1.38
+++ pift.module	6 Jan 2010 03:02:22 -0000
@@ -342,27 +342,12 @@
 }
 
 /**
- * Attempt to determine the Drupal core API version.
+ * Get the core compatible API version term IDs.
  *
- * @param object $node Node object.
- * @return array Core API version information in the format
- *   array($api_version, $api_tid).
+ * @return array Associative array of core compatible API version term IDs.
  */
-function pift_core_api($node) {
-  if (!empty($node->taxonomy)) {
-    // Relase API version vocabulary.
-    $api_vid = _project_release_get_api_vid();
-
-    foreach ($node->taxonomy as $tid => $term) {
-      if ($term->vid == $api_vid) {
-        $api_version = array_shift(explode('.', $term->name, 2));
-        $api_tid = $term->tid;
-
-        return array($api_version, $api_tid);
-      }
-    }
-  }
-  return array(NULL, NULL);
+function pift_core_api_versions() {
+  return array_filter(variable_get('pift_core', array()));
 }
 
 /**
