Преглед на файлове

Small Bug Fixes: undefined index views integration description and undefined constant BLOCK_NO_CACHE errors

Lacey Sanderson преди 11 години
родител
ревизия
6b3cf60a8f

+ 2 - 2
tripal_analysis/tripal_analysis.module

@@ -587,10 +587,10 @@ function tripal_analysis_theme() {
  */
 function tripal_analysis_block_info() {
   $blocks['base']['info'] = t('Tripal Analysis Details');
-  $blocks['base']['cache'] = BLOCK_NO_CACHE;
+  $blocks['base']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['featureblast']['info'] = t('Tripal Feature Analyses');
-  $blocks['featureblast']['cache'] = BLOCK_NO_CACHE;
+  $blocks['featureblast']['cache'] = DRUPAL_NO_CACHE;
 
   return $blocks;
 }

+ 55 - 55
tripal_contact/tripal_contact.module

@@ -47,7 +47,7 @@ function tripal_contact_views_api() {
  * @ingroup tripal_contact
  */
 function tripal_contact_init() {
-  drupal_add_css(drupal_get_path('theme', 'tripal') . '/css/tripal_contact.css');  
+  drupal_add_css(drupal_get_path('theme', 'tripal') . '/css/tripal_contact.css');
 }
 
 /**
@@ -93,7 +93,7 @@ function tripal_contact_menu() {
     'access arguments' => array('administer tripal contacts'),
     'type' => MENU_NORMAL_ITEM
   );
-  
+
   $items['admin/tripal/tripal_contact/configuration'] = array(
     'title' => 'Configuration',
     'description' => 'Integration of Chado contacts.',
@@ -102,8 +102,8 @@ function tripal_contact_menu() {
     'access arguments' => array('administer tripal contact'),
     'type' => MENU_NORMAL_ITEM,
   );
-  
-  
+
+
   $items['admin/tripal/tripal_contact/sync'] = array(
     'title' => ' Sync Contacts',
     'description' => 'Sync contacts in Chado with Drupal',
@@ -112,7 +112,7 @@ function tripal_contact_menu() {
     'access arguments' => array('administer tripal contacts'),
     'type' => MENU_NORMAL_ITEM,
   );
-  
+
   // AJAX calls for adding/removing properties to a contact
   $items['tripal_contact/properties/add'] = array(
     'page callback' => 'tripal_contact_property_add',
@@ -130,10 +130,10 @@ function tripal_contact_menu() {
     'access arguments' => array('edit chado_contact content'),
     'type ' => MENU_CALLBACK,
   );
-  
+
   return $items;
 }
-  
+
 /**
  * Implements hook_theme(): Register themeing functions for this module
  *
@@ -162,11 +162,11 @@ function tripal_contact_theme() {
       'template' => 'tripal_contact_publications',
     ),
     'tripal_contact_admin' => array(
-      'template' => 'tripal_contact_admin',  
-      'arguments' =>  array(NULL),  
-      'path' => drupal_get_path('module', 'tripal_contact') . '/theme' 
+      'template' => 'tripal_contact_admin',
+      'arguments' =>  array(NULL),
+      'path' => drupal_get_path('module', 'tripal_contact') . '/theme'
     ),
-    
+
     // Themed Forms
     'chado_contact_node_form' => array(
       'arguments' => array('form'),
@@ -179,16 +179,16 @@ function tripal_contact_theme() {
 function tripal_contact_block_info() {
 
   $blocks['contbase']['info'] = t('Tripal Contact Details');
-  $blocks['contbase']['cache'] = BLOCK_NO_CACHE;
+  $blocks['contbase']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['contprops']['info'] = t('Tripal Contact Properties');
-  $blocks['contprops']['cache'] = BLOCK_NO_CACHE;
+  $blocks['contprops']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['contrels']['info'] = t('Tripal Contact Relationships');
-  $blocks['contrels']['cache'] = BLOCK_NO_CACHE;
+  $blocks['contrels']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['contpubs']['info'] = t('Tripal Cotact Publications');
-  $blocks['contpubs']['cache'] = BLOCK_NO_CACHE;
+  $blocks['contpubs']['cache'] = DRUPAL_NO_CACHE;
 
   return $blocks;
 }
@@ -261,7 +261,7 @@ function tripal_contact_permissions() {
  *  @param $node
  *  The node on which the operation is to be performed, or, if it does not yet exist, the
  *  type of node to be created
- *  
+ *
  *  @param $op
  *  The operation to be performed
  *
@@ -271,7 +271,7 @@ function tripal_contact_permissions() {
  *  @return
  *  If the permission for the specified operation is not set then return FALSE. If the
  *  permission is set then return NULL as this allows other modules to disable
- *  access.  The only exception is when the $op == 'create'.  We will always 
+ *  access.  The only exception is when the $op == 'create'.  We will always
  *  return TRUE if the permission is set.
  *
  */
@@ -315,8 +315,8 @@ function chado_contact_node_access($node, $op, $account ) {
  *
  */
 function chado_contact_insert($node) {
- 
-  // if a contact_id already exists for this node then it already exists in Chado and 
+
+  // if a contact_id already exists for this node then it already exists in Chado and
   // we get here because we are syncing the node.  Therefore, we can skip the insert
   if ($node->contact_id) {
     $contact['contact_id'] = $node->contact_id;
@@ -334,12 +334,12 @@ function chado_contact_insert($node) {
     if (!$contact) {
       drupal_set_message(t('Could not add the contact'), 'error');
       watchdog('tripal_contact','Could not add the contact', array(), WATCHDOG_ERROR);
-      return FALSE; 
+      return FALSE;
     }
-    
+
     // now add the properties
     $properties = array(); // stores all of the properties we need to add
-  
+
     // get the list of properties for easy lookup (without doing lots of database queries
     $properties_list = array();
     $sql = "
@@ -348,16 +348,16 @@ function chado_contact_insert($node) {
         INNER JOIN {cvterm} CVTS ON CVTP.subject_id = CVTS.cvterm_id
         INNER JOIN {cvterm} CVTO ON CVTP.object_id = CVTO.cvterm_id
         INNER JOIN {cv} CV       ON CVTO.cv_id = CV.cv_id
-      WHERE 
-        CV.name = 'tripal_contact' AND 
-        NOT CVTO.name = 'Contact Type' 
-      ORDER BY CVTS.name ASC 
+      WHERE
+        CV.name = 'tripal_contact' AND
+        NOT CVTO.name = 'Contact Type'
+      ORDER BY CVTS.name ASC
     ";
     $prop_types = chado_query($sql);
     while ($prop = $prop_types->fetchObject()) {
       $properties_list[$prop->cvterm_id] = $prop->name;
-    }   
-  
+    }
+
     // get the properties that should be added. Properties are in one of two forms:
     //  1) prop_value-[type id]-[index]
     //  2) new_value-[type id]-[index]
@@ -375,11 +375,11 @@ function chado_contact_insert($node) {
       $index = count($properties[$name]);
       $name = $properties_list[$type_id];
       $properties[$name][$index] = trim($node->new_value);
-    } 
+    }
     // now add in the properties
     foreach ($properties as $property => $elements) {
       foreach ($elements as $rank => $value) {
-         
+
         $status = tripal_contact_insert_property($contact['contact_id'], $property, $value, FALSE);
         if (!$status) {
           drupal_set_message("Error cannot add property: $property", "error");
@@ -387,16 +387,16 @@ function chado_contact_insert($node) {
           array('%property' => $property), WATCHDOG_ERROR);
         }
       }
-    } 
+    }
   }
 
   // add the record to the chado_contact table in Drupal
-  if ($contact) {   
-   
+  if ($contact) {
+
     // add the description property
     tripal_contact_insert_property($contact['contact_id'], 'contact_description',
       $node->description, TRUE);
-    
+
     // make sure the entry for this contact doesn't already exist in the chado_contact table
     // if it doesn't exist then we want to add it.
     $contact_id = chado_get_id_for_node('contact', $node->nid) ;
@@ -433,17 +433,17 @@ function chado_contact_update($node) {
     // there is no way to handle revisions in Chado but leave
     // this here just to make not we've addressed it.
   }
-  
+
   $contact_id = chado_get_id_for_node('contact', $node->nid) ;
-  
-  // check to see if this contact name doens't already exists.    
+
+  // check to see if this contact name doens't already exists.
   $sql = "SELECT contact_id FROM {contact} WHERE NOT contact_id = :contact_id AND name = :name";
   $contact = chado_query($sql, array(':contact_id' => $contact_id, ':name' => $node->contact_name))->fetchObject();
   if ($contact) {
     drupal_set_message(t('A contact with this name already exists. Cannot perform update.'), 'warning');
-    return;  
-  }    
-  
+    return;
+  }
+
   // update the contact record
   $match = array(
      'contact_id' => $contact_id,
@@ -459,10 +459,10 @@ function chado_contact_update($node) {
     watchdog('t_contact', "Error updating contact", array(), WATCHDOG_ERROR);
     return;
   }
-  
+
   // now update the properties
   $properties = array(); // stores all of the properties we need to add
-   
+
   // get the list of properties for easy lookup (without doing lots of database queries
   $properties_list = array();
   $sql = "
@@ -471,16 +471,16 @@ function chado_contact_update($node) {
       INNER JOIN {cvterm} CVTS ON CVTP.subject_id = CVTS.cvterm_id
       INNER JOIN {cvterm} CVTO ON CVTP.object_id = CVTO.cvterm_id
       INNER JOIN {cv} CV       ON CVTO.cv_id = CV.cv_id
-    WHERE 
-      CV.name = 'tripal_contact' AND 
-      NOT CVTO.name = 'Contact Type' 
-    ORDER BY CVTS.name ASC 
+    WHERE
+      CV.name = 'tripal_contact' AND
+      NOT CVTO.name = 'Contact Type'
+    ORDER BY CVTS.name ASC
   ";
   $prop_types = chado_query($sql);
   while ($prop = $prop_types->fetchObject()) {
     $properties_list[$prop->cvterm_id] = $prop->name;
   }
-  
+
   // get the properties that should be added. Properties are in one of three forms:
   //  1) prop_value-[type id]-[index]
   //  2) new_value-[type id]-[index]
@@ -506,7 +506,7 @@ function chado_contact_update($node) {
     $index = count($properties[$name]);
     $properties[$name][$index] = trim($node->new_value);
   }
-  
+
   // now add in the properties by first removing any the contact
   // already has and adding the ones we have
   tripal_core_chado_delete('contactprop', array('contact_id' => $contact_id));
@@ -519,8 +519,8 @@ function chado_contact_update($node) {
         array('%prop' => $property), WATCHDOG_ERROR);
       }
     }
-  } 
-  
+  }
+
   tripal_contact_update_property($contact_id, 'contact_description', $node->description, 1);
 }
 
@@ -545,7 +545,7 @@ function chado_contact_load($node) {
 
   // get the contact description and replace the contact.description field with this one
   $values = array(
-    'contact_id' => $contact->contact_id, 
+    'contact_id' => $contact->contact_id,
     'type_id' => array(
       'name' => 'contact_description',
     ),
@@ -554,12 +554,12 @@ function chado_contact_load($node) {
     'return_array' => 1,
     'include_fk' => array('type_id' => 1),
   );
-  $description = tripal_core_generate_chado_var('contactprop', $values, $options);    
+  $description = tripal_core_generate_chado_var('contactprop', $values, $options);
   if (count($description) == 1) {
-    $description = tripal_core_expand_chado_vars($description, 'field', 'contactprop.value');  
+    $description = tripal_core_expand_chado_vars($description, 'field', 'contactprop.value');
     $contact->description = $description[0]->value;
   }
-    
+
 
   $additions = new stdClass();
   $additions->contact = $contact;
@@ -674,7 +674,7 @@ function tripal_contact_preprocess_tripal_contact_relationships(&$variables) {
 }
 
 /*
- * 
+ *
  */
 function tripal_contact_form_alter(&$form, &$form_state, $form_id) {
   if ($form_id == "chado_contact_node_form") {

+ 143 - 143
tripal_feature/tripal_feature.module

@@ -131,7 +131,7 @@ function tripal_feature_permissions() {
  *  @param $node
  *  The node on which the operation is to be performed, or, if it does not yet exist, the
  *  type of node to be created
- *  
+ *
  *  @param $op
  *  The operation to be performed
  *
@@ -141,9 +141,9 @@ function tripal_feature_permissions() {
  *  @return
  *  If the permission for the specified operation is not set then return FALSE. If the
  *  permission is set then return NULL as this allows other modules to disable
- *  access.  The only exception is when the $op == 'create'.  We will always 
+ *  access.  The only exception is when the $op == 'create'.  We will always
  *  return TRUE if the permission is set.
- *  
+ *
  * @ingroup tripal_feature
  */
 function chado_feature_node_access($node, $op, $account) {
@@ -189,14 +189,14 @@ function tripal_feature_menu() {
     'access arguments' => array('access chado_feature content'),
     'type' => MENU_CALLBACK,
   );
-  
+
   $items['find/sequences/ajax'] = array(
     'title' => 'Sequence Retrieval',
     'page callback' => 'tripal_feature_seq_extract_form_ahah_update',
     'access arguments' => array('access chado_feature content'),
     'type' => MENU_CALLBACK,
   );
-  
+
   // the administative settings menu
   $items['admin/tripal/tripal_feature'] = array(
     'title' => 'Features',
@@ -339,7 +339,7 @@ function tripal_feature_theme() {
       'arguments' =>  array(NULL),
       'path' => drupal_get_path('module', 'tripal_feature') . '/theme'
     ),
-    
+
     // themed forms
     'tripal_feature_seq_extract_form' => array(
        'arguments' => array('form'),
@@ -354,37 +354,37 @@ function tripal_feature_theme() {
 function tripal_feature_block_info() {
 
   $blocks['references']['info'] = t('Tripal Feature References');
-  $blocks['references']['cache'] = BLOCK_NO_CACHE;
+  $blocks['references']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['base']['info'] = t('Tripal Feature Details');
-  $blocks['base']['cache'] = BLOCK_NO_CACHE;
+  $blocks['base']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['sequence']['info'] = t('Tripal Feature Sequence');
-  $blocks['sequence']['cache'] = BLOCK_NO_CACHE;
+  $blocks['sequence']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['featureloc_sequences']['info'] = t('Tripal Feature Annotated Sequence');
-  $blocks['featureloc_sequences']['cache'] = BLOCK_NO_CACHE;
+  $blocks['featureloc_sequences']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['synonyms']['info'] = t('Tripal Feature Synonyms');
-  $blocks['synonyms']['cache'] = BLOCK_NO_CACHE;
+  $blocks['synonyms']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['properties']['info'] = t('Tripal Feature Properties');
-  $blocks['properties']['cache'] = BLOCK_NO_CACHE;;
+  $blocks['properties']['cache'] = DRUPAL_NO_CACHE;;
 
   $blocks['terms']['info'] = t('Tripal Annotated Terms');
-  $blocks['terms']['cache'] = BLOCK_NO_CACHE;;
+  $blocks['terms']['cache'] = DRUPAL_NO_CACHE;;
 
   $blocks['alignments']['info'] = t('Tripal Feature Alignments');
-  $blocks['alignments']['cache'] = BLOCK_NO_CACHE;
+  $blocks['alignments']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['relationships']['info'] = t('Tripal Feature Relationships');
-  $blocks['relationships']['cache'] = BLOCK_NO_CACHE;
+  $blocks['relationships']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['org_feature_counts']['info'] = t('Tripal Organism Feature Counts');
-  $blocks['org_feature_counts']['cache'] = BLOCK_NO_CACHE;
+  $blocks['org_feature_counts']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['org_feature_browser']['info'] = t('Tripal Organism Feature Browser');
-  $blocks['org_feature_browser']['cache'] = BLOCK_NO_CACHE;
+  $blocks['org_feature_browser']['cache'] = DRUPAL_NO_CACHE;
 
   return $blocks;
 }
@@ -394,11 +394,11 @@ function tripal_feature_block_info() {
  * @ingroup tripal_feature
  */
 function tripal_feature_block_view($delta = '') {
-  
+
   if (user_access('access chado_feature content') and arg(0) == 'node' and is_numeric(arg(1))) {
     $nid = arg(1);
     $node = node_load($nid);
-  
+
     $block = array();
     switch ($delta) {
       case 'references':
@@ -511,24 +511,24 @@ function chado_feature_insert($node) {
     'type_id' => $type[0]->cvterm_id,
   );
   $feature = tripal_core_chado_select('feature', array('feature_id'), $values);
-    
+
   // add the genbank accession and synonyms
   chado_feature_add_synonyms($node->synonyms, $feature[0]->feature_id);
 
   // make sure the entry for this feature doesn't already exist in the chado_feature table
   // if it doesn't exist then we want to add it.
   $node_check_sql = "
-    SELECT * FROM {chado_feature} 
+    SELECT * FROM {chado_feature}
     WHERE feature_id = :feature_id
   ";
   $node_check = db_query($node_check_sql, array(':feature_id' => $feature[0]->feature_id))->fetchObject();
   if (!$node_check) {
     // next add the item to the drupal table
     $sql = "
-      INSERT INTO {chado_feature} (nid, vid, feature_id, sync_date) 
+      INSERT INTO {chado_feature} (nid, vid, feature_id, sync_date)
       VALUES (:nid, :vid, :feature_id, :time)
     ";
-    db_query($sql, array(':nid' => $node->nid, ':vid' => $node->vid, 
+    db_query($sql, array(':nid' => $node->nid, ':vid' => $node->vid,
       ':feature_id' => $feature[0]->feature_id, ':time' => REQUEST_TIME));
   }
 }
@@ -577,7 +577,7 @@ function chado_feature_update($node) {
     );
     $options = array('return_record' => TRUE);
     $status = tripal_core_chado_update('feature', $match, $values, $options);
-    
+
     // add the genbank synonyms
     chado_feature_add_synonyms($node->synonyms, $feature_id);
   }
@@ -589,7 +589,7 @@ function chado_feature_update($node) {
     WATCHDOG_WARNING
     );
   }
-  
+
 
 }
 /**
@@ -662,11 +662,11 @@ function chado_feature_add_synonyms($synonyms, $feature_id) {
     $synonym = chado_query($synonym_sql, array(':name' => $syn))->fetchObject();
     if (!$synonym) {
       $synonym_isql = "
-        INSERT INTO {synonym} (name, synonym_sgml, type_id) 
-        VALUES (:name, :synonym_sgml, 
-          (SELECT cvterm_id 
-           FROM {CVTerm} CVT 
-             INNER JOIN CV ON CVT.cv_id = CV.cv_id 
+        INSERT INTO {synonym} (name, synonym_sgml, type_id)
+        VALUES (:name, :synonym_sgml,
+          (SELECT cvterm_id
+           FROM {CVTerm} CVT
+             INNER JOIN CV ON CVT.cv_id = CV.cv_id
            WHERE CV.name = 'feature_property' and CVT.name = 'synonym')
           )
       ";
@@ -680,7 +680,7 @@ function chado_feature_add_synonyms($synonyms, $feature_id) {
 
     // now add in our new sysnonym
     $feature_syn_isql = "
-      INSERT INTO {feature_synonym} (synonym_id,feature_id,pub_id) 
+      INSERT INTO {feature_synonym} (synonym_id,feature_id,pub_id)
       VALUES (:synonym_id, :feature_id, :pub_id)";
     $args = array(':synonym_id' => $synonym->synonym_id, ':feature_id' => $feature_id, ':pub_id'=> 1);
     if (!chado_query($feature_syn_isql, $args)) {
@@ -703,12 +703,12 @@ function chado_feature_add_gbaccession($accession, $feature_id) {
 
   // remove any old accession from genbank dbEST
   $fdbxref_dsql = "
-    DELETE FROM {feature_dbxref} 
-    WHERE feature_id = :feature_id and dbxref_id IN 
-      (SELECT DBX.dbxref_id 
-       FROM {dbxref} DBX 
-         INNER JOIN DB  ON DB.db_id = DBX.db_id 
-         INNER JOIN feature_dbxref FDBX ON DBX.dbxref_id = FDBX.dbxref_id 
+    DELETE FROM {feature_dbxref}
+    WHERE feature_id = :feature_id and dbxref_id IN
+      (SELECT DBX.dbxref_id
+       FROM {dbxref} DBX
+         INNER JOIN DB  ON DB.db_id = DBX.db_id
+         INNER JOIN feature_dbxref FDBX ON DBX.dbxref_id = FDBX.dbxref_id
        WHERE DB.name = 'DB:Genbank' and FDBX.feature_id = :feature_id
       )
   ";
@@ -841,8 +841,8 @@ function chado_feature_form($node, $param) {
 
   // get the sequence ontology CV ID
   $values = array('name' => 'sequence');
-  $cv = tripal_core_chado_select('cv', array('cv_id'), $values); 
-  $cv_id = $cv[0]->cv_id; 
+  $cv = tripal_core_chado_select('cv', array('cv_id'), $values);
+  $cv_id = $cv[0]->cv_id;
 
   $form['feature_type'] = array(
    '#title'       => t('Feature Type'),
@@ -917,7 +917,7 @@ function chado_feature_form($node, $param) {
  */
 function chado_feature_validate($node) {
   $result = 0;
-  
+
   // make sure the feature type is a real sequence ontology term
   $type = tripal_cv_get_cvterm_by_name($node->feature_type, NULL, 'sequence');
   if (!$type) {
@@ -932,13 +932,13 @@ function chado_feature_validate($node) {
       SELECT *
       FROM {feature} F
         INNER JOIN {cvterm} CVT ON F.type_id = CVT.cvterm_id
-      WHERE 
-        F.uniquename     = :uname AND 
-        F.organism_id    = :orgnism_id AND 
-        CVT.name         = :cvtname AND 
+      WHERE
+        F.uniquename     = :uname AND
+        F.organism_id    = :orgnism_id AND
+        CVT.name         = :cvtname AND
         NOT f.feature_id = :feature_id
     ";
-    $args = array(':uname' => $node->uniquename, ':organism_id' => $node->organism_id, 
+    $args = array(':uname' => $node->uniquename, ':organism_id' => $node->organism_id,
       ':cvtname' => $node->feature_type, ':feature_id' => $node->feature_id);
     $result = chado_query($sql, $args)->fetchObject();
     if ($result) {
@@ -953,9 +953,9 @@ function chado_feature_validate($node) {
       SELECT *
       FROM {feature} F
         INNER JOIN {cvterm} CVT ON F.type_id = CVT.cvterm_id
-      WHERE 
-        F.uniquename  = :name AND 
-        F.organism_id = :organism_id AND 
+      WHERE
+        F.uniquename  = :name AND
+        F.organism_id = :organism_id AND
         CVT.name      = :cvtname
     ";
     $args = array(':name' => $node->uniquename, ':organism_id' => $node->organism_id, ':cvtname' => $node->feature_type);
@@ -992,10 +992,10 @@ function chado_feature_load($node) {
     if (strcmp($feature->name, $feature->uniquename)==0) {
       $node->title = $feature->name . " (" . $feature->type_id->name . ") " . $feature->organism_id->genus . " " . $feature->organism_id->species ;
     }
-    // in previous version of Tripal, the feature title was simply the unique name. 
+    // in previous version of Tripal, the feature title was simply the unique name.
     // so, we recreate the title just to be sure all of our feature pages are consistent
     else {
-      $node->title = $feature->name . ", " . $feature->uniquename . " (" . $feature->type_id->name . ") " . $feature->organism_id->genus . " " . $feature->organism_id->species ;  
+      $node->title = $feature->name . ", " . $feature->uniquename . " (" . $feature->type_id->name . ") " . $feature->organism_id->genus . " " . $feature->organism_id->species ;
     }
   }
   // set the title to be the feature name or uniquename as configured
@@ -1003,7 +1003,7 @@ function chado_feature_load($node) {
     $node->title = $feature->name;
   }
   if ($title_type == 'feature_unique_name') {
-    $node->title = $feature->uniquename;  
+    $node->title = $feature->uniquename;
   }
 
   $additions = new stdClass();
@@ -1029,11 +1029,11 @@ function tripal_feature_load_organism($organism_id) {
 function tripal_feature_load_synonyms($feature_id) {
 
   $sql = "
-    SELECT S.name 
-    FROM {feature_synonym} FS 
-      INNER JOIN {synonym} S  ON FS.synonym_id = S.Synonym_id 
+    SELECT S.name
+    FROM {feature_synonym} FS
+      INNER JOIN {synonym} S  ON FS.synonym_id = S.Synonym_id
     WHERE FS.feature_id = :feature_id
-    ORDER BY S.name 
+    ORDER BY S.name
    ";
   $results = chado_query($sql, array(':feature_id' => $feature_id));
   $synonyms = array();
@@ -1051,16 +1051,16 @@ function tripal_feature_load_synonyms($feature_id) {
 function tripal_feature_load_properties($feature_id) {
 
   $sql = "
-    SELECT 
-      CVT.name as cvname, CVT.definition, CVT.is_obsolete, 
-      FS.type_id, FS.value, FS.rank,      
+    SELECT
+      CVT.name as cvname, CVT.definition, CVT.is_obsolete,
+      FS.type_id, FS.value, FS.rank,
       DBX.dbxref_id,DBX.accession,DB.name as dbname,
       DB.urlprefix, DB.description as db_description, DB.url
     FROM {featureprop} FS
       INNER JOIN {cvterm} CVT ON FS.type_id    = CVT.cvterm_id
       INNER JOIN {dbxref} DBX ON CVT.dbxref_id = DBX.dbxref_id
       INNER JOIN {db} DB      ON DB.db_id      = DBX.db_id
-    WHERE 
+    WHERE
       FS.feature_id = :feature_id
     ORDER BY FS.rank ASC
   ";
@@ -1080,17 +1080,17 @@ function tripal_feature_load_properties($feature_id) {
 function tripal_feature_load_references($feature_id) {
 
   $sql = "
-    SELECT 
+    SELECT
        F.uniquename, F.Feature_id,
        DB.description as dbdesc, DB.db_id, DB.name as db_name, DB.urlprefix,
-       DBX.accession, DBX.dbxref_id 
-    FROM {feature} F 
-      INNER JOIN {feature_dbxref} FDBX ON F.feature_id  = FDBX.feature_id 
-      INNER JOIN {dbxref} DBX          ON DBX.dbxref_id = FDBX.dbxref_id 
-      INNER JOIN {db}                  ON DB.db_id      = DBX.db_id 
-    WHERE 
+       DBX.accession, DBX.dbxref_id
+    FROM {feature} F
+      INNER JOIN {feature_dbxref} FDBX ON F.feature_id  = FDBX.feature_id
+      INNER JOIN {dbxref} DBX          ON DBX.dbxref_id = FDBX.dbxref_id
+      INNER JOIN {db}                  ON DB.db_id      = DBX.db_id
+    WHERE
       F.feature_id = :feature_id
-    ORDER BY DB.name 
+    ORDER BY DB.name
   ";
   $results = chado_query($sql, array(':feature_id' => $feature_id));
   $references = array();
@@ -1126,7 +1126,7 @@ function tripal_feature_load_featurelocs($feature_id, $side = 'as_parent', $aggr
   if (strcmp($side, 'as_child')==0) {
     $sql .= "WHERE FL.feature_id = :feature_id ";
   }
-  
+
   $flresults = chado_query($sql, array(':feature_id' => $feature_id));
 
   // copy the results into an array
@@ -1185,7 +1185,7 @@ function tripal_feature_load_relationships($feature_id, $side = 'as_subject') {
       FR.subject_id, FR.type_id as relationship_type_id, FR.object_id, FR.rank,
       CVT.name as rel_type,
       FO.name as object_name, FO.uniquename as object_uniquename,
-      CVTO.name as object_type, CVTO.cvterm_id as object_type_id      
+      CVTO.name as object_type, CVTO.cvterm_id as object_type_id
     FROM {feature_relationship} FR
      INNER JOIN {cvterm} CVT  ON FR.type_id    = CVT.cvterm_id
      INNER JOIN {feature} FS  ON FS.feature_id = FR.subject_id
@@ -1298,8 +1298,8 @@ function tripal_feature_load_featureloc_sequences($feature_id, $featurelocs) {
   // location and then annotate it with the parts found from the relationships
   // locations determiend above.
   $sql = "
-    SELECT substring(residues from :start for :size) as residues 
-    FROM {feature} 
+    SELECT substring(residues from :start for :size) as residues
+    FROM {feature}
     WHERE feature_id = :feature_id
   ";
   $floc_sequences = array();
@@ -1395,37 +1395,37 @@ function tripal_feature_get_matched_alignments($feature) {
   // match, or %_match
   //
    $sql = "
-     SELECT  
-       FL1.featureloc_id    as left_featureloc_id, 
-       FL1.srcfeature_id    as left_srcfeature_id, 
-       FL1.feature_id       as left_feature_id, 
-       FL1.fmin             as left_fmin, 
-       FL1.is_fmin_partial  as left_is_fmin_partial, 
-       FL1.fmax             as left_fmax, 
-       FL1.is_fmax_partial  as left_is_fmax_partial, 
-       FL1.strand           as left_strand,  
-       FL1.phase            as left_phase, 
-       FL1.locgroup         as left_locgroup, 
-       FL1.rank             as left_rank, 
-       FL2.featureloc_id    as right_featureloc_id, 
-       FL2.srcfeature_id    as right_srcfeature_id, 
-       FL2.feature_id       as right_feature_id, 
-       FL2.fmin             as right_fmin, 
-       FL2.is_fmin_partial  as right_is_fmin_partial, 
-       FL2.fmax             as right_fmax, 
-       FL2.is_fmax_partial  as right_is_fmax_partial, 
-       FL2.strand           as right_strand,  
-       FL2.phase            as right_phase, 
-       FL2.locgroup         as right_locgroup, 
-       FL2.rank             as right_rank 
-     FROM {feature} F1 
-       INNER JOIN {featureloc} FL1 on FL1.srcfeature_id = F1.feature_id 
-       INNER JOIN {feature} F2 on FL1.feature_id = F2.feature_id 
-       INNER JOIN {featureloc} FL2 on FL2.feature_id = F2.feature_id 
-       INNER JOIN {cvterm} CVT2 on F2.type_id = CVT2.cvterm_id 
-     WHERE 
-       F1.feature_id = :feature_id  AND 
-       (CVT2.name = 'match' or CVT2.name like '%_match') 
+     SELECT
+       FL1.featureloc_id    as left_featureloc_id,
+       FL1.srcfeature_id    as left_srcfeature_id,
+       FL1.feature_id       as left_feature_id,
+       FL1.fmin             as left_fmin,
+       FL1.is_fmin_partial  as left_is_fmin_partial,
+       FL1.fmax             as left_fmax,
+       FL1.is_fmax_partial  as left_is_fmax_partial,
+       FL1.strand           as left_strand,
+       FL1.phase            as left_phase,
+       FL1.locgroup         as left_locgroup,
+       FL1.rank             as left_rank,
+       FL2.featureloc_id    as right_featureloc_id,
+       FL2.srcfeature_id    as right_srcfeature_id,
+       FL2.feature_id       as right_feature_id,
+       FL2.fmin             as right_fmin,
+       FL2.is_fmin_partial  as right_is_fmin_partial,
+       FL2.fmax             as right_fmax,
+       FL2.is_fmax_partial  as right_is_fmax_partial,
+       FL2.strand           as right_strand,
+       FL2.phase            as right_phase,
+       FL2.locgroup         as right_locgroup,
+       FL2.rank             as right_rank
+     FROM {feature} F1
+       INNER JOIN {featureloc} FL1 on FL1.srcfeature_id = F1.feature_id
+       INNER JOIN {feature} F2 on FL1.feature_id = F2.feature_id
+       INNER JOIN {featureloc} FL2 on FL2.feature_id = F2.feature_id
+       INNER JOIN {cvterm} CVT2 on F2.type_id = CVT2.cvterm_id
+     WHERE
+       F1.feature_id = :feature_id  AND
+       (CVT2.name = 'match' or CVT2.name like '%_match')
      ORDER BY FL1.fmin
    ";
 
@@ -1608,24 +1608,24 @@ function tripal_feature_load_library_feature_browser($library) {
 
   // get the features for this library
   $sql  = "
-    SELECT F.name, F.feature_id, F.uniquename, CVT.name as cvname 
-    FROM {feature} F 
-      INNER JOIN {cvterm} CVT         ON F.type_id = CVT.cvterm_id 
-      INNER JOIN {library_feature} LF ON F.feature_id = LF.feature_id 
-      INNER JOIN {library} L          ON LF.library_id = L.library_id 
-    WHERE LF.library_id = :library_id and ($where_cvt) 
+    SELECT F.name, F.feature_id, F.uniquename, CVT.name as cvname
+    FROM {feature} F
+      INNER JOIN {cvterm} CVT         ON F.type_id = CVT.cvterm_id
+      INNER JOIN {library_feature} LF ON F.feature_id = LF.feature_id
+      INNER JOIN {library} L          ON LF.library_id = L.library_id
+    WHERE LF.library_id = :library_id and ($where_cvt)
     ORDER BY feature_id ASC
   ";
   $args[':library_id'] = $library->libary_id;
-  
+
   // the counting SQL
   $csql  = "
-    SELECT count(*) 
+    SELECT count(*)
     FROM {feature} F
-      INNER JOIN {cvterm} CVT on F.type_id = CVT.cvterm_id 
-      INNER JOIN {library_feature} LF on F.feature_id = LF.feature_id 
-      INNER JOIN {library} L on LF.library_id = L.library_id 
-    WHERE LF.library_id = :library_id and ($where_cvt) 
+      INNER JOIN {cvterm} CVT on F.type_id = CVT.cvterm_id
+      INNER JOIN {library_feature} LF on F.feature_id = LF.feature_id
+      INNER JOIN {library} L on LF.library_id = L.library_id
+    WHERE LF.library_id = :library_id and ($where_cvt)
       GROUP BY L.library_id ";
 
   $org_features = chado_pager_query($sql, 10, 0, $csql, $args);
@@ -1675,25 +1675,25 @@ function tripal_feature_load_analysis_feature_browser($analysis) {
 
   // get the features for this library
   $sql  = "
-    SELECT F.name,F.feature_id,F.uniquename,CVT.name as cvname 
-    FROM {feature} F 
-      INNER JOIN {cvterm} CVT on F.type_id = CVT.cvterm_id 
-      INNER JOIN {analysisfeature} AF on F.feature_id = AF.feature_id 
-      INNER JOIN {analysis} A on AF.analysis_id = A.analysis_id 
-    WHERE A.analysis_id = :analysis_id and ($where_cvt) 
+    SELECT F.name,F.feature_id,F.uniquename,CVT.name as cvname
+    FROM {feature} F
+      INNER JOIN {cvterm} CVT on F.type_id = CVT.cvterm_id
+      INNER JOIN {analysisfeature} AF on F.feature_id = AF.feature_id
+      INNER JOIN {analysis} A on AF.analysis_id = A.analysis_id
+    WHERE A.analysis_id = :analysis_id and ($where_cvt)
     ORDER BY feature_id ASC
   ";
   $args[':analysis_id'] = $analysis->analysis_id;
 
   // the counting SQL
   $csql  = "
-    SELECT count(*) 
+    SELECT count(*)
     FROM {feature} F
-      INNER JOIN {cvterm} CVT on F.type_id = CVT.cvterm_id 
-      INNER JOIN {analysisfeature} AF on F.feature_id = AF.feature_id 
-      INNER JOIN {analysis} A on AF.analysis_id = A.analysis_id 
-    WHERE A.analysis_id = %d and ($where_cvt) 
-    GROUP BY A.analysis_id 
+      INNER JOIN {cvterm} CVT on F.type_id = CVT.cvterm_id
+      INNER JOIN {analysisfeature} AF on F.feature_id = AF.feature_id
+      INNER JOIN {analysis} A on AF.analysis_id = A.analysis_id
+    WHERE A.analysis_id = %d and ($where_cvt)
+    GROUP BY A.analysis_id
   ";
 
   $org_features = chado_pager_query($sql, 10, 0, $csql, $args);
@@ -1843,11 +1843,11 @@ function tripal_feature_color_sequence($sequence, $parts, $defline) {
  * @ingroup tripal_feature
  */
 function tripal_feature_node_presave($node) {
-  
+
   // set the title to ensure it is always unique
   switch ($node->type) {
     case 'chado_feature':
-      
+
       $values = array('organism_id' => $node->organism_id);
       $organism = tripal_core_chado_select('organism', array('genus', 'species'), $values);
       $node->title = $node->fname . ', ' . $node->uniquename . ' (' . $node->feature_type . ') ' . $organism[0]->genus . ' ' . $organism[0]->species;
@@ -1860,9 +1860,9 @@ function tripal_feature_node_presave($node) {
  * @ingroup tripal_feature
  */
 function tripal_feature_node_insert($node) {
-  
-  // set the URL path after inserting.  We do it here because we do not 
-  // know the feature_id in the presave 
+
+  // set the URL path after inserting.  We do it here because we do not
+  // know the feature_id in the presave
   switch ($node->type) {
     case 'chado_feature':
       if (!$node->feature_id) {
@@ -1870,10 +1870,10 @@ function tripal_feature_node_insert($node) {
         $chado_feature = db_query($sql, array(':nid' => $node->nid))->fetchObject();
         $node->feature_id = $chado_feature->feature_id;
       }
-      
+
       // remove any previous alias
       db_query("DELETE FROM {url_alias} WHERE src = :src", array(':src' => "node/$node->nid"));
-      
+
       // set the URL for this feature page
       $url_alias = tripal_feature_get_feature_url($node);
       path_set_alias("node/$node->nid", $url_alias);
@@ -1910,14 +1910,14 @@ function tripal_feature_node_view($node, $view_mode, $langcode) {
  *
  * @ingroup tripal_feature
  */
-function tripal_feature_node_update($node) { 
-  
+function tripal_feature_node_update($node) {
+
   // add items to other nodes, build index and search results
   switch ($node->type) {
     case 'chado_feature':
       // remove any previous alias
       db_query("DELETE FROM {url_alias} WHERE src = :src", array(':src' => "node/$node->nid"));
-      
+
       // set the URL for this feature page
       $url_alias = tripal_feature_get_feature_url($node);
       path_set_alias("node/$node->nid", $url_alias);
@@ -2315,15 +2315,15 @@ function tripal_feature_coder_ignore() {
  * features is shown.
  */
 function tripal_feature_match_features_page($id) {
-  
+
   // if the URL alias configuration is set such that the URL
   // always begins with 'feature' then we want to use the ID as it is and
   // forward it on. Otherwise, try to find the matching feature.
-  $url_alias = variable_get('chado_feature_url_string', '/feature/[genus]/[species]/[type]/[uniquename]'); 
+  $url_alias = variable_get('chado_feature_url_string', '/feature/[genus]/[species]/[type]/[uniquename]');
   if (!$url_alias) {
     $url_alias = '/feature/[genus]/[species]/[type]/[uniquename]';
-  } 
-  $url_alias = preg_replace('/^\//', '', $url_alias); // remove any preceeding forward slash  
+  }
+  $url_alias = preg_replace('/^\//', '', $url_alias); // remove any preceeding forward slash
   if (preg_match('/^feature\//', $url_alias)) {
     drupal_goto($id);
   }
@@ -2388,16 +2388,16 @@ function tripal_feature_match_features_page($id) {
 }
 
 /**
- * 
+ *
  * @param unknown_type $form
  * @param unknown_type $form_state
  * @param unknown_type $form_id
  */
 function tripal_feature_form_alter(&$form, &$form_state, $form_id) {
-  if ($form_id == "tripal_feature_seq_extract_form") {    
+  if ($form_id == "tripal_feature_seq_extract_form") {
     // updating the form through the ahah callback sets the action of
     // the form to the ahah callback URL. We need to set it back
     // to the normal form URL
     $form['#action'] = url("find/sequences");
   }
-} 
+}

+ 35 - 35
tripal_featuremap/tripal_featuremap.module

@@ -159,7 +159,7 @@ function tripal_featuremap_menu() {
     'access arguments' => array('administer tripal featuremap'),
     'type' => MENU_CALLBACK
   );
-  
+
   // AJAX calls for adding/removing properties to a featuremap
   $items['tripal_featuremap/properties/add'] = array(
     'page callback' => 'tripal_featuremap_property_add',
@@ -235,11 +235,11 @@ function tripal_featuremap_theme() {
       'arguments' =>  array(NULL),
       'path' => drupal_get_path('module', 'tripal_featuremap') . '/theme'
     ),
-    
+
     // Themed Forms
     'chado_featuremap_node_form' => array(
      'arguments' => array('form'),
-    ),      
+    ),
   );
 }
 
@@ -249,20 +249,20 @@ function tripal_featuremap_theme() {
 function tripal_featuremap_block_info() {
 
   $blocks['mapbase']['info'] = t('Tripal Map Details');
-  $blocks['mapbase']['cache'] = BLOCK_NO_CACHE;
+  $blocks['mapbase']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['mapprops']['info'] = t('Tripal Map Properties');
-  $blocks['mapprops']['cache'] = BLOCK_NO_CACHE;
-  
+  $blocks['mapprops']['cache'] = DRUPAL_NO_CACHE;
+
   $blocks['mappos']['info'] = t('Tripal Map Features');
-  $blocks['mappos']['cache'] = BLOCK_NO_CACHE;
-  
+  $blocks['mappos']['cache'] = DRUPAL_NO_CACHE;
+
   $blocks['mappubs']['info'] = t('Tripal Map Publications');
-  $blocks['mappubs']['cache'] = BLOCK_NO_CACHE;
+  $blocks['mappubs']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['maprefs']['info'] = t('Tripal Map References');
-  $blocks['maprefs']['cache'] = BLOCK_NO_CACHE;
-    
+  $blocks['maprefs']['cache'] = DRUPAL_NO_CACHE;
+
   return $blocks;
 }
 /**
@@ -336,7 +336,7 @@ function tripal_featuremap_cron() {
  *  @return
  *  If the permission for the specified operation is not set then return FALSE. If the
  *  permission is set then return NULL as this allows other modules to disable
- *  access.  The only exception is when the $op == 'create'.  We will always 
+ *  access.  The only exception is when the $op == 'create'.  We will always
  *  return TRUE if the permission is set.
  *
  * @ingroup tripal_featuremap
@@ -384,7 +384,7 @@ function chado_featuremap_node_access($node, $op, $account) {
  */
 function chado_featuremap_insert($node) {
 
-  // if the featuremap_id already exists then we got to the insert via 
+  // if the featuremap_id already exists then we got to the insert via
   // a syncing operation.  We do not need to add the feature map
   if ($node->featuremap_id) {
     $featuremap['featuremap_id'] = $node->featuremap_id;
@@ -400,29 +400,29 @@ function chado_featuremap_insert($node) {
       drupal_set_message(t('Unable to add featuremap.', 'warning'));
       watchdog('tripal_featuremap', 'Unable to create feature map where values: %values',
         array('%values' => print_r($values, TRUE)), WATCHDOG_WARNING);
-      return;  
+      return;
     }
-    
+
     // now add the properties
     $properties = array(); // stores all of the properties we need to add
     $cross_refs = array(); // stores any cross references for this featuremap
-  
+
     // get the list of properties for easy lookup (without doing lots of database queries
     $properties_list = array();
     $sql = "
       SELECT DISTINCT CVT.cvterm_id, CVT.name, CVT.definition
       FROM  {cvterm} CVT
         INNER JOIN {cv} ON CVT.cv_id = CV.cv_id
-      WHERE 
-        CV.name = 'featuremap_property' AND 
+      WHERE
+        CV.name = 'featuremap_property' AND
         NOT CVT.is_obsolete = 1
-      ORDER BY CVT.name ASC 
+      ORDER BY CVT.name ASC
     ";
     $prop_types = chado_query($sql);
     while ($prop = $prop_types->fetchObject()) {
       $properties_list[$prop->cvterm_id] = $prop->name;
-    }   
-  
+    }
+
     // get the properties that should be added. Properties are in one of two forms:
     //  1) prop_value-[type id]-[index]
     //  2) new_value-[type id]-[index]
@@ -441,8 +441,8 @@ function chado_featuremap_insert($node) {
       $name = $properties_list[$type_id];
       $properties[$name][$index] = trim($node->new_value);
     }
-    
-    // iterate through all of the properties to see if the Map dbxref is set, 
+
+    // iterate through all of the properties to see if the Map dbxref is set,
     // if so, add it to the $cross_refs array
     foreach ($properties as $name => $element) {
       foreach ($element as $index => $value) {
@@ -453,11 +453,11 @@ function chado_featuremap_insert($node) {
         }
       }
     }
-    
+
     // now add in the properties
     foreach ($properties as $property => $elements) {
       foreach ($elements as $rank => $value) {
-         
+
         $status = tripal_featuremap_insert_property($featuremap['featuremap_id'], $property, $value, FALSE);
         if (!$status) {
           drupal_set_message("Error cannot add property: $property", "error");
@@ -466,7 +466,7 @@ function chado_featuremap_insert($node) {
         }
       }
     }
-  
+
     // add in any database cross-references
     foreach ($cross_refs as $index => $ref) {
       $featuremap_dbxref = tripal_featuremap_add_featuremap_dbxref($featuremap['featuremap_id'], trim($ref));
@@ -486,7 +486,7 @@ function chado_featuremap_insert($node) {
     if (!$featuremap_id) {
        // next add the item to the drupal table
       $sql = "
-        INSERT INTO {chado_featuremap} (nid, vid, featuremap_id) 
+        INSERT INTO {chado_featuremap} (nid, vid, featuremap_id)
         VALUES (:nid, :vid, :featuremap_id)
       ";
       db_query($sql, array(':nid' => $node->nid, ':vid' => $node->vid, ':featuremap_id' => $featuremap['featuremap_id']));
@@ -524,23 +524,23 @@ function chado_featuremap_update($node) {
   // now update the properties
   $properties = array(); // stores all of the properties we need to add
   $cross_refs = array(); // stores any cross references for this map
-   
+
   // get the list of properties for easy lookup (without doing lots of database queries
   $properties_list = array();
   $sql = "
     SELECT DISTINCT CVT.cvterm_id, CVT.name, CVT.definition
     FROM  {cvterm} CVT
       INNER JOIN {cv} ON CVT.cv_id = CV.cv_id
-    WHERE 
-      CV.name = 'featuremap_property' AND 
+    WHERE
+      CV.name = 'featuremap_property' AND
       NOT CVT.is_obsolete = 1
-    ORDER BY CVT.name ASC 
+    ORDER BY CVT.name ASC
   ";
   $prop_types = chado_query($sql);
   while ($prop = $prop_types->fetchObject()) {
     $properties_list[$prop->cvterm_id] = $prop->name;
   }
-  
+
   // get the properties that should be added. Properties are in one of three forms:
   //  1) prop_value-[type id]-[index]
   //  2) new_value-[type id]-[index]
@@ -566,8 +566,8 @@ function chado_featuremap_update($node) {
     $index = count($properties[$name]);
     $properties[$name][$index] = trim($node->new_value);
   }
-  
-  // iterate through all of the properties to see if the Map dbxref is set, 
+
+  // iterate through all of the properties to see if the Map dbxref is set,
   // if so, add it to the $cross_refs array
   foreach ($properties as $name => $element) {
     foreach ($element as $index => $value) {
@@ -616,7 +616,7 @@ function chado_featuremap_load($node) {
 
   $values = array('featuremap_id' => $featuremap_id);
   $featuremap = tripal_core_generate_chado_var('featuremap', $values);
-  
+
   // expand the description field as it is needed by the form
   $featuremap = tripal_core_expand_chado_vars($featuremap, 'field', 'featuremap.description');
 

+ 22 - 22
tripal_library/tripal_library.module

@@ -87,7 +87,7 @@ function tripal_library_permisssions() {
  * Implement hook_access().
  *
  * This hook allows node modules to limit access to the node types they define.
- * 
+ *
  *  @param $node
  *  The node on which the operation is to be performed, or, if it does not yet exist, the
  *  type of node to be created
@@ -101,7 +101,7 @@ function tripal_library_permisssions() {
  *  @return
  *  If the permission for the specified operation is not set then return FALSE. If the
  *  permission is set then return NULL as this allows other modules to disable
- *  access.  The only exception is when the $op == 'create'.  We will always 
+ *  access.  The only exception is when the $op == 'create'.  We will always
  *  return TRUE if the permission is set.
  *
  * @ingroup tripal_library
@@ -263,25 +263,25 @@ function tripal_library_theme() {
 function tripal_library_block_info() {
 
   $blocks['libreferences']['info'] = t('Tripal Library Cross References');
-  $blocks['libreferences']['cache'] = BLOCK_NO_CACHE;
+  $blocks['libreferences']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['libbase']['info'] = t('Tripal Library Details');
-  $blocks['libbase']['cache'] = BLOCK_NO_CACHE;
+  $blocks['libbase']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['libterms']['info'] = t('Tripal Library Terms');
-  $blocks['libterms']['cache'] = BLOCK_NO_CACHE;
+  $blocks['libterms']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['libsynonyms']['info'] = t('Tripal Library Synonyms');
-  $blocks['libsynonyms']['cache'] = BLOCK_NO_CACHE;
+  $blocks['libsynonyms']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['libproperties']['info'] = t('Tripal Library Properties');
-  $blocks['libproperties']['cache'] = BLOCK_NO_CACHE;
+  $blocks['libproperties']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['featurelibs']['info'] = t('Tripal Feature Libraries');
-  $blocks['featurelibs']['cache'] = BLOCK_NO_CACHE;
+  $blocks['featurelibs']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['orglibs']['info'] = t('Tripal Organism Libraries');
-  $blocks['orglibs']['cache'] = BLOCK_NO_CACHE;
+  $blocks['orglibs']['cache'] = DRUPAL_NO_CACHE;
 
   return $blocks;
 }
@@ -347,9 +347,9 @@ function theme_tripal_library_search_index($node) {
     while ($library = $results->fetchObject()) {
       // get the description
       $sql = "
-        SELECT * 
-        FROM {libraryprop} LP 
-          INNER JOIN {cvterm} CVT ON CVT.cvterm_id = LP.type_id 
+        SELECT *
+        FROM {libraryprop} LP
+          INNER JOIN {cvterm} CVT ON CVT.cvterm_id = LP.type_id
         WHERE LP.library_id = :library_id
           AND CVT.name = 'library_description'
       ";
@@ -369,11 +369,11 @@ function theme_tripal_library_search_index($node) {
     $content = "";
     $organism_id = $node->feature->organism_id;
     $sql = "
-      SELECT * 
-      FROM {library} L 
-        INNER JOIN {library_feature} LF ON L.library_id = LF.library_id 
+      SELECT *
+      FROM {library} L
+        INNER JOIN {library_feature} LF ON L.library_id = LF.library_id
       WHERE LF.feature_id = :feature_id
-    "; 
+    ";
     $libraries = array();
     $results = chado_query($sql, array(':feature_id' => $node->feature->feature_id));
     while ($library = $results->fetchObject()) {
@@ -414,9 +414,9 @@ function theme_tripal_library_node_libraries($node) {
   elseif ($node->type == 'chado_feature' && $node->feature->feature_id) {
     $organism_id = $node->feature->organism_id;
     $sql = "
-      SELECT * 
-      FROM {library} L 
-        INNER JOIN Library_feature LF ON L.library_id = LF.library_id 
+      SELECT *
+      FROM {library} L
+        INNER JOIN Library_feature LF ON L.library_id = LF.library_id
       WHERE LF.feature_id = :feature_id
     ";
     $libraries = array();
@@ -575,8 +575,8 @@ function chado_library_validate($node) {
   // before we try to insert into chado.
   if ($node->library_id) {
     $sql = "
-      SELECT * 
-      FROM {library} 
+      SELECT *
+      FROM {library}
       WHERE uniquename = :uname AND NOT library_id = :library_id
     ";
     $lib = chado_query($sql, array(':uname' => $node->uniquename, ':library_id' => $node->library_id))->fetchObject();
@@ -622,7 +622,7 @@ function chado_library_insert($node) {
     if (!$library_id) {
        // next add the item to the drupal table
       $sql = "
-        INSERT INTO {chado_library} (nid, vid, library_id) 
+        INSERT INTO {chado_library} (nid, vid, library_id)
         VALUES (:nid, :vid, :library_id)
       ";
       db_query($sql, array(':nid' => $node->nid, ':vid' => $node->vid, ':library_id' => $library['library_id']));

+ 3 - 3
tripal_organism/tripal_organism.module

@@ -46,13 +46,13 @@ function tripal_organism_node_info() {
 function tripal_organism_block_info() {
 
   $blocks['base']['info'] = t('Tripal Organism Details');
-  $blocks['base']['cache'] = BLOCK_NO_CACHE;
+  $blocks['base']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['description']['info'] = t('Tripal Organism Description');
-  $blocks['description']['cache'] = BLOCK_NO_CACHE;
+  $blocks['description']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['image']['info'] = t('Tripal Organism Image');
-  $blocks['image']['cache'] = BLOCK_NO_CACHE;
+  $blocks['image']['cache'] = DRUPAL_NO_CACHE;
 
   return $blocks;
 

+ 6 - 6
tripal_project/tripal_project.module

@@ -344,7 +344,7 @@ function chado_project_insert($node) {
     if (!$project_id) {
        // next add the item to the drupal table
       $sql = "
-        INSERT INTO {chado_project} (nid, vid, project_id) 
+        INSERT INTO {chado_project} (nid, vid, project_id)
         VALUES (:nid, :vid, :project_id)
       ";
       db_query($sql, array(':nid' => $node->nid, ':vid' => $node->vid, ':project_id' => $project['project_id']));
@@ -452,19 +452,19 @@ function chado_project_load($node) {
 function tripal_project_block_info() {
 
   $blocks['projectbase']['info'] = t('Tripal Project Details');
-  $blocks['projectbase']['cache'] = BLOCK_NO_CACHE;
+  $blocks['projectbase']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['projectprops']['info'] = t('Tripal Project Properties');
-  $blocks['projectprops']['cache'] = BLOCK_NO_CACHE;
+  $blocks['projectprops']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['projectpubs']['info'] = t('Tripal Project Publications');
-  $blocks['projectpubs']['cache'] = BLOCK_NO_CACHE;
+  $blocks['projectpubs']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['projectcont']['info'] = t('Tripal Project Contact');
-  $blocks['projectcont']['cache'] = BLOCK_NO_CACHE;
+  $blocks['projectcont']['cache'] = DRUPAL_NO_CACHE;
 
   $blocks['projectrels']['info'] = t('Tripal Project Relationships');
-  $blocks['projectrels']['cache'] = BLOCK_NO_CACHE;
+  $blocks['projectrels']['cache'] = DRUPAL_NO_CACHE;
 
   return $blocks;
 }

+ 1 - 1
tripal_views/api/tripal_views.api.inc

@@ -603,7 +603,7 @@ function tripal_views_get_integration_array_for_chado_table($table_name, $base_t
         'name' => $field_name,
         'title' => ucwords(str_replace('_', ' ', $field_name)),
         'type' => $field_schema['type'],
-        'description' => ($field_schema['description']) ? $field_schema['description'] : ucwords(str_replace('_', ' ', $field_name)),
+        'description' => (isset($field_schema['description'])) ? $field_schema['description'] : ucwords(str_replace('_', ' ', $field_name)),
         'handlers' => array(),
         'joins' => array()
       );