Browse Source

Merge branch '7.x-3.x' into 7.x-2.x-ds

Stephen Ficklin 8 years ago
parent
commit
3316188cf4

+ 2 - 2
tripal/includes/tripal.fields.inc

@@ -687,13 +687,13 @@ function tripal_field_formatter_settings_summary($field, $instance, $view_mode)
 /**
  * Implements hook_field_formatter_settings_form().
  */
-function tripal_formatter_settings_form($field, $instance,
+function tripal_field_formatter_settings_form($field, $instance,
     $view_mode, $form, &$form_state) {
 
   $formatter_class = $field['type'] . '_formatter';
   if (tripal_load_include_field_class($formatter_class)) {
     $formatter = new $formatter_class($field, $instance);
-    return $formatter->settingsSummaryForm($view_mode, $form, $form_state);
+    return $formatter->settingsForm($view_mode, $form, $form_state);
   }
 }
 

+ 0 - 33
tripal/tripal.module

@@ -162,18 +162,6 @@ function tripal_menu() {
 //     'weight' => -100,
 //   );
 
-
-/*
-  $items['admin/tripal/setup/customize'] = array(
-    'title' => 'Customize Tripal',
-    'description' => t('Information on how to customize tripal'),
-    'page callback' => 'theme',
-    'page arguments' => array('tripal_customize'),
-    'access arguments' => array('administer tripal'),
-    'weight' => 10
-  );
-*/
-
   // Jobs Management
   $items['admin/tripal/tripal_jobs'] = array(
     'title' => 'Jobs',
@@ -326,27 +314,6 @@ function tripal_permission() {
  */
 function tripal_theme($existing, $type, $theme, $path) {
   $themes = array(
-    'tripal_customize' => array(
-      'arguments' => array('job_id' => NULL),
-      'template' => 'tripal_customize',
-      'path' => "$path/theme/templates"
-    ),
-    'theme_file_upload_combo' => array(
-      'render element' => 'element',
-    ),
-    'theme_sequence_combo' => array(
-      'render element' => 'element',
-    ),
-    'tripal_jobs_help' => array(
-      'template' => 'tripal_jobs_help',
-      'variables' =>  array(NULL),
-      'path' => "$path/theme/templates"
-    ),
-    'tripal_customtables_help' => array(
-      'template' => 'tripal_customtables_help',
-      'variables' =>  array(NULL),
-      'path' => "$path/theme/templates"
-    ),
     // Admin messages theme
     'tripal_admin_message' => array(
       'function' => 'theme_tripal_admin_message',

+ 0 - 17
tripal_chado/includes/TripalFields.old/chado_base__dbxref_id.inc

@@ -78,20 +78,9 @@ class chado_base__dbxref_id extends TripalField {
     $options = tripal_get_db_select_options();
 
     //$widget['#element_validate'] = array('chado_base__dbxref_id_widget_validate');
-    $widget['#theme'] = 'chado_base__dbxref_id_widget';
     $widget['#prefix'] =  "<span id='$field_name-dbxref--db-id'>";
     $widget['#suffix'] =  "</span>";
 
-    // A temporary element used for theming the fieldset.
-    $widget['#theme_settings'] = array(
-      '#title' => $element['#title'],
-      '#description' =>  $element['#description'],
-      '#weight' => isset($element['#weight']) ? $element['#weight'] : 0,
-      '#theme' => 'chado_base__dbxref_id_widget',
-      //'#collapsible' => TRUE,
-      //'#collapsed' => $collapsed,
-    );
-
     $widget['value'] = array(
       '#type' => 'value',
       '#value' => array_key_exists($delta, $items) ? $items[$delta]['value'] : '',
@@ -336,12 +325,6 @@ function theme_chado_base__dbxref_id_widget($variables) {
       </div>
     ";
 
-  //   $classes = array();
-  //   $classes[] = 'collapsible';
-  //   $theme_settings = $element['#theme_settings'];
-  //   if ($theme_settings['#collapsed'] == FALSE) {
-  //     $classes[] = 'collapsed';
-  //   }
   $fieldset = array(
     '#title' => $element['#title'],
     '#value' => '',

+ 2 - 2
tripal_chado/includes/TripalFields/ChadoField.inc

@@ -25,7 +25,7 @@ class ChadoField extends TripalField {
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
-  public static $default_instance_settings  = array(
+  public static $default_instance_settings = array(
     // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'schema',
     // The name of the term.
@@ -38,7 +38,7 @@ class ChadoField extends TripalField {
     'term_fixed' => FALSE,
     // The table in Chado that the instance maps to.
     'chado_table' => '',
-    // The primary key column of hte table in Dhado.
+    // The column of the table in Chado where the value of the field comes from.
     'chado_column' => '',
     // The base table.
     'base_table' => '',

+ 0 - 16
tripal_chado/includes/TripalFields/data__accession/data__accession_widget.inc

@@ -50,16 +50,6 @@ class data__accession_widget extends ChadoFieldWidget {
     $widget['#prefix'] =  "<span id='$field_name-dbxref--db-id'>";
     $widget['#suffix'] =  "</span>";
 
-    // A temporary element used for theming the fieldset.
-    $widget['#theme_settings'] = array(
-      '#title' => $element['#title'],
-      '#description' =>  $element['#description'],
-      '#weight' => isset($element['#weight']) ? $element['#weight'] : 0,
-//      '#theme' => 'data__accession_widget',
-      //'#collapsible' => TRUE,
-      //'#collapsed' => $collapsed,
-    );
-
     $widget['value'] = array(
       '#type' => 'value',
       '#value' => array_key_exists($delta, $items) ? $items[$delta]['value'] : '',
@@ -174,12 +164,6 @@ class data__accession_widget extends ChadoFieldWidget {
       </div>
     ";
 
-    //   $classes = array();
-    //   $classes[] = 'collapsible';
-    //   $theme_settings = $element['#theme_settings'];
-    //   if ($theme_settings['#collapsed'] == FALSE) {
-    //     $classes[] = 'collapsed';
-    //   }
     $fieldset = array(
       '#title' => $element['#title'],
       '#value' => '',

+ 34 - 3
tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship_formatter.inc

@@ -7,12 +7,43 @@ class sbo__relationship_formatter extends ChadoFieldFormatter {
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('sbo__relationship');
 
+  public static $default_settings = array(
+    'title' => 'Relationship',
+    'empty' => 'There are no relationships',
+  );
+
   /**
    *
    * @see TripalFieldFormatter::settingsForm()
    */
   public function settingsForm($view_mode, $form, &$form_state) {
+    $display = $this->instance['display'][$view_mode];
+    $settings = $display['settings'];
+    $element = array();
+    $element['title'] = array(
+      '#type' => 'textfield',
+      '#title' => 'Relationship Title',
+      '#default_value' => array_key_exists('title', $settings) ? $settings['title'] : 'Relationship',
+    );
+    $element['empty'] = array(
+      '#type' => 'textfield',
+      '#title' => 'Empty text',
+      '#default_value' => array_key_exists('empty', $settings) ? $settings['empty'] : 'There are no relationships',
+    );
+
+    return $element;
+  }
 
+  /**
+   * @see TripalFieldFormatter::settingsSummary()
+   */
+  public function settingsSummary($view_mode) {
+    $display = $this->instance['display'][$view_mode];
+    $settings = $display['settings'];
+
+    $summary = t('Title: @title<br>Empty: @empty', array('@title' => $settings['title'], '@empty' => $settings['empty']));
+
+    return $summary;
   }
 
   /**
@@ -24,8 +55,7 @@ class sbo__relationship_formatter extends ChadoFieldFormatter {
     $settings = $display['settings'];
 
     $rows = array();
-    $headers = array('Subject' ,'Type', 'Object');
-    $headers = array('Relationship');
+    $headers = array($settings['title']);
 
     foreach ($items as $delta => $item) {
       if (!$item['value']) {
@@ -73,6 +103,7 @@ class sbo__relationship_formatter extends ChadoFieldFormatter {
     // options for controlling the display of the table.  Additional
     // documentation can be found here:
     // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
+
     $table = array(
       'header' => $headers,
       'rows' => $rows,
@@ -83,7 +114,7 @@ class sbo__relationship_formatter extends ChadoFieldFormatter {
       'sticky' => FALSE,
       'caption' => '',
       'colgroups' => array(),
-      'empty' => 'There are no relationships',
+      'empty' => $settings['empty'],
     );
 
     // once we have our table array structure defined, we call Drupal's theme_table()

+ 15 - 6
tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship_widget.inc

@@ -401,12 +401,21 @@ class sbo__relationship_widget extends ChadoFieldWidget {
         $object_id = $object[0]->$fkey_rcolumn;
       }
     }
-
-    // Set the IDs according to the values that were determined above.
-    $form_state['values'][$field_name][$langcode][$delta]['chado-' . $field_table . '__' . $subject_id_key] = $subject_id;
-    $form_state['values'][$field_name][$langcode][$delta]['chado-' . $field_table . '__' . $object_id_key] = $object_id;
-    $form_state['values'][$field_name][$langcode][$delta]['chado-' . $field_table . '__type_id'] = $type_name;
-    $form_state['values'][$field_name][$langcode][$delta]['chado-' . $field_table . '__rank'] = $form_state['values'][$field_name][$langcode][$delta]['_weight'];
+    
+    if ($subject_id && $object_id && $type_id) {
+      // Set the IDs according to the values that were determined above.
+      $form_state['values'][$field_name][$langcode][$delta]['chado-' . $field_table . '__' . $subject_id_key] = $subject_id;
+      $form_state['values'][$field_name][$langcode][$delta]['chado-' . $field_table . '__' . $object_id_key] = $object_id;
+      $form_state['values'][$field_name][$langcode][$delta]['chado-' . $field_table . '__type_id'] = $type_id;
+      $form_state['values'][$field_name][$langcode][$delta]['chado-' . $field_table . '__rank'] = $form_state['values'][$field_name][$langcode][$delta]['_weight'];
+    }
+    else {
+      $form_state['values'][$field_name][$langcode][$delta]['chado-' . $field_table . '__' . $subject_id_key] = '';
+      $form_state['values'][$field_name][$langcode][$delta]['chado-' . $field_table . '__' . $object_id_key] = '';
+      $form_state['values'][$field_name][$langcode][$delta]['chado-' . $field_table . '__type_id'] = '';
+      $form_state['values'][$field_name][$langcode][$delta]['chado-' . $field_table . '__value'] = '';
+      $form_state['values'][$field_name][$langcode][$delta]['chado-' . $field_table . '__rank'] = '';
+    }
   }
 
   /**

+ 2 - 2
tripal_chado/includes/TripalFields/schema__publication/schema__publication_formatter.inc

@@ -24,8 +24,8 @@ class schema__publication_formatter extends ChadoFieldFormatter {
     $chado_table = $this->instance['settings']['chado_table'];
     foreach ($items as $delta => $item) {
       
-      $title = $item['value']['Title'];
-      $citation = $item['value']['Citation'];
+      $title = isset($item['value']['Title']) ? $item['value']['Title'] : '';
+      $citation = isset($item['value']['Citation']) ? $item['value']['Citation'] : '';
       $entity = array_key_exists('entity', $item['value']) ? $item['value']['entity'] : '';
       if ($entity) {
         list($entity_type, $entity_id) = explode(':', $entity);

+ 0 - 6
tripal_chado/includes/TripalFields/uo__unit/uo__unit.inc

@@ -35,12 +35,6 @@ class uo__unit extends ChadoField {
   public static $default_formatter = 'UO__unit_formatter';
 
 
-  /**
-   * @see TripalField::validate()
-   */
-  public function validate($entity_type, $entity, $field, $items, &$errors) {
-  }
-
   /**
    * @see TripalField::load()
    */

+ 3 - 6
tripal_chado/includes/tripal_chado.field_storage.inc

@@ -364,6 +364,7 @@ function tripal_chado_field_storage_write_merge_fields($fields, $entity_type, $e
       // A field may have multiple items. The field can use items
       // indexed with "chado-" to represent values that should map directly
       // to chado tables and fields.
+      $value_set = FALSE;
       foreach ($item as $item_name => $value) {
         $matches = array();
         if (preg_match('/^chado-(.*?)__(.*?)$/', $item_name, $matches)) {
@@ -377,16 +378,14 @@ function tripal_chado_field_storage_write_merge_fields($fields, $entity_type, $e
           else {
             $temp[$table_name][$delta][$column_name] = $value;
           }
+          $value_set = TRUE;
         }
       }
 
       // If there is no value set for the field using the
       // chado-[table_name]__[field name] naming schema then check if a 'value'
       // item is present and if so use that for the table column value.
-      if ((!array_key_exists($chado_table, $temp) or
-           !array_key_exists($delta, $temp[$chado_table]) or
-           !array_key_exists($chado_column, $temp[$chado_table][$delta])) and
-          array_key_exists('value', $items[$delta]) and
+      if (!$value_set and array_key_exists('value', $items[$delta]) and
           !is_array($items[$delta]['value'])) {
         // If this field belongs to the base table then we just add
         // those values in... there's no delta.
@@ -554,9 +553,7 @@ function tripal_chado_field_storage_query($query) {
     } // end if ($sort['type'] == 'field') {
   } // end foreach ($query->order as $index => $sort) {
 
-dpm($cquery);
   $records = $cquery->execute();
-  dpm($records);
 
   $result = array();
   while ($record = $records->fetchObject()) {

+ 23 - 22
tripal_chado/includes/tripal_chado.fields.inc

@@ -92,7 +92,7 @@ function tripal_chado_bundle_create_fields_base(&$info, $details, $entity_type,
       'field_name' => $field_name,
       'type' => '',
       'cardinality' => 1,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -188,7 +188,7 @@ function tripal_chado_bundle_create_fields_custom(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => 1,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -204,7 +204,7 @@ function tripal_chado_bundle_create_fields_custom(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => 1,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -219,7 +219,7 @@ function tripal_chado_bundle_create_fields_custom(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => 1,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -234,7 +234,7 @@ function tripal_chado_bundle_create_fields_custom(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => 1,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -249,7 +249,7 @@ function tripal_chado_bundle_create_fields_custom(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => 1,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -264,7 +264,7 @@ function tripal_chado_bundle_create_fields_custom(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => 1,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -280,7 +280,7 @@ function tripal_chado_bundle_create_fields_custom(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -295,7 +295,7 @@ function tripal_chado_bundle_create_fields_custom(&$info, $details, $entity_type
 //       'field_name' => $field_name,
 //       'type' => $field_type,
 //       'cardinality' => 1,
-//       'locked' => TRUE,
+//       'locked' => FALSE,
 //       'storage' => array(
 //         'type' => 'field_chado_storage',
 //       ),
@@ -312,7 +312,7 @@ function tripal_chado_bundle_create_fields_custom(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => 1,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -342,7 +342,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => 1,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -358,7 +358,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' =>  $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -374,7 +374,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -389,7 +389,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -404,7 +404,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -420,7 +420,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -436,7 +436,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -475,7 +475,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -492,7 +492,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -509,7 +509,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -525,7 +525,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -670,6 +670,7 @@ function tripal_chado_bundle_create_instances_base(&$info, $entity_type, $bundle
         $base_info['widget']['type'] = 'text_textfield';
         break;
       case 'text':
+        $base_info['display']['default']['label'] = 'above';
         $base_info['widget']['type'] = 'text_textarea';
         $base_info['settings']['text_processing'] = '1';
         $base_info['settings']['format'] = 'full_html';
@@ -736,7 +737,7 @@ function tripal_chado_bundle_create_instances_base(&$info, $entity_type, $bundle
     //
     elseif ($table_name == 'analysis' and $column_name == 'program') {
       $base_info['description'] = 'The program name (e.g. blastx, blastp, sim4, genscan. If the analysis was not derived from a software package then provide a very brief description of the pipeline, workflow or method.';
-      $base_info['label'] = 'Program, Pipeline, Workflow or Method Name.';
+      $base_info['label'] = 'Program, Pipeline, Workflow or Method Name';
     }
     elseif ($table_name == 'analysis' and $column_name == 'sourceuri') {
       $base_info['widget_type'] = 'text_textfield';

+ 3 - 40
tripal_chado/tripal_chado.module

@@ -616,43 +616,6 @@ function tripal_chado_permission() {
 function tripal_chado_theme($existing, $type, $theme, $path) {
   $themes = array(
 
-    // Theme fields.
-     'data__accession_widget' => array(
-       'render element' => 'element',
-       'file' => 'includes/TripalFields/data__accession/data__accession_widget.inc',
-     ),
-     'sbo__database_cross_reference_widget' => array(
-       'render element' => 'element',
-       'file' => 'includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference_widget.inc',
-     ),
-//     'chado_linker__cvterm_widget' => array(
-//       'render element' => 'element',
-//       'file' => 'includes/TripalFields/chado_linker__cvterm.inc',
-//     ),
-     'schema__alternate_name_widget' => array(
-       'render element' => 'element',
-       'file' => 'includes/TripalFields/schema__alternate_name/schema__alternate_name_widget.inc',
-     ),
-//     'chado_linker__relationship_widget' => array(
-//       'render element' => 'element',
-//       'file' => 'includes/TripalFields/chado_linker__relationship.inc',
-//     ),
-//     'chado_linker__relationship_instance_settings' => array(
-//       'render element' => 'element',
-//       'file' => 'includes/TripalFields/chado_linker__relationship.inc',
-//     ),
-//     'chado_linker__pub_widget' => array(
-//       'render element' => 'element',
-//       'file' => 'includes/TripalFields/chado_linker__pub.inc',
-//     ),
-//     'chado_linker__contact_widget' => array(
-//       'render element' => 'element',
-//       'file' => 'includes/TripalFields/chado_linker__contact.inc',
-//     ),
-//     'chado_linker__prop_adder_widget' => array(
-//       'render element' => 'element',
-//       'file' => 'includes/TripalFields/chado_linker__prop_adder.inc',
-//     ),
     'tripal_chado_date_combo' => array(
       'render element' => 'element',
       'file' => 'theme/tripal_chado.theme.inc',
@@ -681,7 +644,7 @@ function tripal_chado_theme($existing, $type, $theme, $path) {
       ->execute();
 
     // Iterate through all of the TripalEntity bundles and see which ones
-    // map to tables that used had Tripal v2 nodes.  For those, if the
+    // map to tables that used to have Tripal v2 nodes.  For those, if the
     // legacy support is turned on then we want to use the legacy template.
     while ($bundle = $bundles->fetchObject()) {
       $term = tripal_load_term_entity(array('term_id' => $bundle->term_id));
@@ -692,9 +655,9 @@ function tripal_chado_theme($existing, $type, $theme, $path) {
       );
       $mapped_table = chado_get_cvterm_mapping($params);
 
-      // Do not proceed if there is not a mapped_table
+      // Do not proceed if there is not a mapped_table.
       if (!$mapped_table) {
-        return;
+        continue;
       }
 
       $chado_table = $mapped_table->chado_table;