Browse Source

Merge branch '6.x-dev' of git.drupal.org:sandbox/spficklin/1337878 into 6.x-dev

Lacey Sanderson 12 years ago
parent
commit
e0418d9b7b
2 changed files with 19 additions and 8 deletions
  1. 6 6
      tripal_core/api/tripal_core.api.inc
  2. 13 2
      tripal_feature/tripal_feature.module

+ 6 - 6
tripal_core/api/tripal_core.api.inc

@@ -353,10 +353,10 @@ function tripal_core_chado_insert($table, $values, $options = array()) {
   if ($options['return_record'] == TRUE and $result) {
     if (array_key_exists('primary key', $table_desc) and is_array($table_desc['primary key'])) {
       foreach ($table_desc['primary key'] as $field) {
-        $psql = "PREPARE currval_$table AS SELECT CURRVAL('" . $table . "_" . $field . "_seq')";
-        $is_prepared = tripal_core_chado_prepare("currval_$table", $psql, array());
+        $psql = "PREPARE currval_" . $table . "_" . $field . " AS SELECT CURRVAL('" . $table . "_" . $field . "_seq')";
+        $is_prepared = tripal_core_chado_prepare("currval_" . $table . "_" . $field, $psql, array());
         if ($is_prepared) {
-           $value = db_fetch_object(chado_query("EXECUTE currval_$table"));
+           $value = db_result(chado_query("EXECUTE currval_". $table . "_" . $field));
         }
         else {
           $sql = "SELECT CURRVAL('" . $table . "_" . $field . "_seq')";
@@ -2794,9 +2794,9 @@ function tripal_core_chado_prepare($statement_name, $psql, $args) {
     }
     else {
       // Although a statement with this name is already prepared it is not the same!
-      watchdog('tripal_core', "chado_prepare: '%name' statement already prepared with different arguments! You want to prepare %sql with %values and the existing statement is %esql with %existing",
-        array('%name' => $statement_name, '%sql' => $psql, '%values' => print_r($args, TRUE), '%esql' => $prepared_sql,
-          '%existing' => print_r($prepared_args, TRUE)), WATCHDOG_ERROR);
+      watchdog('tripal_core', "chado_prepare: statement, '%name', is already prepared with different arguments! The current statement: \n%sql. The current arguments: \n%args. The already prepared statement: \n%esql\nThe current arguments: \n%existing. ",
+        array('%name' => $statement_name, '%sql' => $psql, '%esql' => $prepared_sql,
+          '%existing' => print_r($prepared_args, TRUE), '%args' => print_r($args, TRUE)), WATCHDOG_ERROR);
       return FALSE;
     }
   }

+ 13 - 2
tripal_feature/tripal_feature.module

@@ -346,6 +346,9 @@ function tripal_feature_block($op = 'list', $delta = 0, $edit=array()) {
       $blocks['properties']['info'] = t('Tripal Feature Properties');
       $blocks['properties']['cache'] = BLOCK_NO_CACHE;;
 
+      $blocks['terms']['info'] = t('Tripal Annotated Terms');
+      $blocks['terms']['cache'] = BLOCK_NO_CACHE;;
+
       $blocks['alignments']['info'] = t('Tripal Feature Alignments');
       $blocks['alignments']['cache'] = BLOCK_NO_CACHE;
 
@@ -382,7 +385,11 @@ function tripal_feature_block($op = 'list', $delta = 0, $edit=array()) {
         case 'properties':
           $block['subject'] = t('Properties');
           $block['content'] = theme('tripal_feature_properties', $node);
-          break;;
+          break;
+        case 'terms':
+          $block['subject'] = t('Annotated Terms');
+          $block['content'] = theme('tripal_feature_terms', $node);
+          break;
         case 'sequence':
           $block['subject'] = t('Sequence');
           $block['content'] = theme('tripal_feature_sequence', $node);
@@ -1944,6 +1951,10 @@ function tripal_feature_theme() {
        'arguments' => array('node' => NULL),
        'template' => 'tripal_feature_properties',
     ),
+    'tripal_feature_terms' => array(
+       'arguments' => array('node' => NULL),
+       'template' => 'tripal_feature_terms',
+    ),
     'tripal_feature_alignments' => array(
        'arguments' => array('node' => NULL),
        'template' => 'tripal_feature_alignments',
@@ -2827,4 +2838,4 @@ function tripal_feature_match_features_page($id) {
   $output = "<p>The following features match the name '$id'.</p>";
   $output .= theme_table($header, $rows, $table_attrs, $caption);
   return $output;
-}
+}