소스 검색

Fixed issues with field renaming

Stephen Ficklin 9 년 전
부모
커밋
04e587b9d6

+ 2 - 0
legacy/tripal_analysis/tripal_analysis.install

@@ -257,10 +257,12 @@ function tripal_analysis_add_mview_analysis_organism() {
     'description' => $comment,
     'fields' => array(
       'analysis_id' => array(
+        'size' => 'big',
         'type' => 'int',
         'not null' => TRUE,
       ),
       'organism_id' => array(
+        'size' => 'big',
         'type' => 'int',
         'not null' => TRUE,
       ),

+ 2 - 0
legacy/tripal_feature/tripal_feature.install

@@ -252,6 +252,7 @@ function tripal_feature_add_organism_count_mview() {
     'table' => $view_name,
     'fields' => array(
       'organism_id' => array(
+        'size' => 'big',
         'type' => 'int',
         'not null' => TRUE,
       ),
@@ -275,6 +276,7 @@ function tripal_feature_add_organism_count_mview() {
         'not null' => TRUE,
       ),
       'cvterm_id' => array(
+        'size' => 'big',
         'type' => 'int',
         'not null' => TRUE,
       ),

+ 3 - 1
tripal/includes/TripalEntityController.inc

@@ -283,8 +283,10 @@ class TripalEntityController extends EntityAPIController {
         'uid'       => $user->uid,
         'created'   => $entity->created,
         'changed'   => time(),
-        'nid' => $entity->nid,
       );
+      if (property_exists($entity, 'nid') and $entity->nid) {
+        $record['nid'] = $entity->nid;
+      }
       if ($invocation == 'entity_update') {
         $record['id'] = $entity->id;
       }

+ 219 - 0
tripal_chado/api/generate_chado_schema_file.php

@@ -0,0 +1,219 @@
+<?php
+/**
+ * @file
+ *
+ * This script will generate the schema file for the Tripal API for an
+ * installation of Chado. To use the script you must install the version of
+ * Chado desired using Tripal. Next install and enable the 'schema' module
+ * from the Drupal module respository.  Finally, add a new 'chado'
+ * entry in the $databases variable of the settings.php file. For
+ * example:
+ *
+ * @code
+ *'chado' => array(
+    'default' => array(
+      'database' => 'd7x_t2x_c13',
+      'username' => 'chado',
+      'password' => 'testing123',
+      'host' => 'localhost',
+      'port' => '',
+      'driver' => 'pgsql',
+      'prefix' => '',
+    ),
+  ),
+ * @endcode
+ *
+ * This script requires a single argument (-v) which is the Chado version.
+ * Redirect output into a new file as desired.
+ *
+ * Example usage in drupal directory root:
+ *
+ * php ./sites/all/modules/tripal/tripal_core/api/generate_chado_schema_file.php -v 1.11 > \
+ *   ./sites/all/modules/tripal/tripal_core/api/tripal_core.schema_v1.11.api.inc.new
+ *
+ * php ./sites/all/modules/tripal/tripal_core/api/generate_chado_schema_file.php -v 1.2 > \
+ *   ./sites/all/modules/tripal/tripal_core/api/tripal_core.schema_v1.2.api.inc.new
+ *
+ * php ./sites/all/modules/tripal/tripal_core/api/generate_chado_schema_file.php -v 1.3 > \
+ *   ./sites/all/modules/tripal/tripal_core/api/tripal_core.schema_v1.3.api.inc.new
+ */
+
+$arguments = getopt("v:");
+
+if (isset($arguments['v'])) {
+  $drupal_base_url = parse_url('http://www.example.com');
+  $_SERVER['HTTP_HOST'] = $drupal_base_url['host'];
+  $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF'];
+  $_SERVER['REMOTE_ADDR'] = NULL;
+  $_SERVER['REQUEST_METHOD'] = NULL;
+
+  define('DRUPAL_ROOT', getcwd());
+
+  require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
+  drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+
+  $version = $arguments['v'];
+  $safe_version = preg_replace('/\./', '_', $version);
+
+  print("<?php \n" .
+    "/**\n" .
+    " * @file\n" .
+    " * Describes the chado tables in version $version\n" .
+    " */\n" .
+    "\n" .
+    "/**\n" .
+    " * @defgroup tripal_schema_v" . $safe_version . "_api Chado v" . $version . " Schema API\n" .
+    " * @ingroup tripal_chado_schema_api\n" .
+    " * @{\n" .
+    " * Provides an application programming interface (API) for describing Chado\n" .
+    " * tables. This API consists of a set of functions, one for each table in Chado.\n" .
+    " * Each function simply returns a Drupal style array that defines the table.\n" .
+    " *\n" .
+    " * Because Drupal does not handle foreign key (FK) relationships, which are\n" .
+    " * needed to for Tripal Views, they have been added to the schema defintitions\n" .
+    " * below.\n" .
+    " *\n" .
+    " * The functions provided in this documentation should not be called as is,\n" .
+    " * but if you need the Drupal-style array definition for any table, use the\n" .
+    " * following function call:\n" .
+    " *\n" .
+    " *   \$table_desc = chado_get_schema(\$table)\n" .
+    " *\n" .
+    " * where the variable \$table contains the name of the table you want to\n" .
+    " * retireve.  The chado_get_schema function determines the appropriate version\n" .
+    " * of Chado and uses the Drupal hook infrastructure to call the appropriate\n" .
+    " * hook function to retrieve the table schema.\n" .
+    " *\n" .
+    " * If you need to augment these schema definitions within your own module,\n" .
+    " * you need to implement the hook_chado_schema_v" . $safe_version . "_[table name]() hook where\n" .
+    " * [table name] is the name of the chado table whose schema definition you\n" .
+    " * want to augment.\n" .
+    " * @}\n" .
+    " */\n"
+  );
+
+  // The SQL for retreiving details about a table.
+  $fksql ="
+    SELECT
+        tc.constraint_name, tc.table_name, kcu.column_name,
+        ccu.table_name AS foreign_table_name,
+        ccu.column_name AS foreign_column_name
+    FROM
+        information_schema.table_constraints AS tc
+        JOIN information_schema.key_column_usage AS kcu ON tc.constraint_name = kcu.constraint_name
+        JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name
+    WHERE constraint_type = 'FOREIGN KEY' AND tc.table_name=:table_name
+  ";
+
+  // Iterate through the tables of Chado and use the Schema module to
+  // generate a schema array for each table.
+  $sql = "
+    SELECT table_name
+    FROM information_schema.tables
+    WHERE
+      table_schema = 'chado' AND
+      table_type = 'BASE TABLE' AND
+      table_name NOT like 'tripal%'
+    ORDER BY table_name
+  ";
+  $result = db_query($sql);
+  $table_schemas = array();
+  $referring = array();
+  while ($table = $result->fetchField()) {
+
+    // Get the schema for each table.
+    $schema = schema_dbobject('chado')->inspect(NULL, $table);
+    $schema = $schema[$table];
+
+    // Get the foreign keys and add them to the array.
+    $fks = db_query($fksql, array(':table_name' => $table));
+    $schema['foreign keys'] = array();
+    foreach ($fks as $fk) {
+      $schema['foreign keys'][$fk->foreign_table_name]['table'] = $fk->foreign_table_name;
+      $schema['foreign keys'][$fk->foreign_table_name]['columns'][$fk->column_name] = $fk->foreign_column_name;
+      $reffering[$fk->foreign_table_name][] = $table;
+    }
+
+    // Add a table and description key to the top.
+    $schema = array('table' => $table) + $schema;
+    $schema = array('description' => '') + $schema;
+
+    // Fix the datetime fields and add a description field.
+    foreach ($schema['fields'] as $fname => $details) {
+      if ($schema['fields'][$fname]['type'] == "timestamp without time zone") {
+        $schema['fields'][$fname]['type'] = 'datetime';
+      }
+      $schema['fields'][$fname]['description'] = '';
+    }
+
+    // Remove the 'name' key.
+    unset($schema['name']);
+
+    $table_schemas[$table] = $schema;
+  }
+
+  // Now iterate through the tables now that we have all the referring info
+  // and generate the function strings.
+  foreach ($table_schemas as $table => $schema) {
+
+    $schema['referring_tables'] = array();
+    if (count($reffering[$table]) > 0) {
+      $schema['referring_tables'] = array_unique($reffering[$table]);
+    }
+
+    // Reformat the array to be more legible.
+    $arr = var_export($schema, 1);
+    // Move array( to previous line.
+    $arr = preg_replace("/\n\s+array/","array", $arr);
+    // Add indentation.
+    $arr = preg_replace("/\n/","\n  ", $arr);
+    $arr = preg_replace("/true/","TRUE", $arr);
+    $arr = preg_replace("/false/","FALSE", $arr);
+    $arr = preg_replace("/array \(/","array(", $arr);
+
+    print (
+      "/**\n" .
+      " * Implements hook_chado_schema_v" . $safe_version . "_" . $table . "()\n" .
+      " * \n" .
+      " * Purpose: To describe the structure of '$table' to tripal\n" .
+      " * @see chado_insert_record()\n" .
+      " * @see chado_update_record()\n" .
+      " * @see chado_select_record()\n" .
+      " * @see chado_generate_var()\n" .
+      " * @see chado_expan_var()\n" .
+      " *\n" .
+      " * @return\n" .
+      " *    An array describing the '$table' table\n" .
+      " *\n" .
+      " * @ingroup tripal_chado_v" . $version . "_schema_api\n" .
+      " *\n" .
+      " */\n" .
+      "function tripal_core_chado_schema_v" . $safe_version . "_" . $table . "() {\n" .
+      "  \$description = $arr; \n " .
+      "  return \$description;\n" .
+      "}\n"
+    );
+  }
+  // Finally add the tables function for this version.
+  $table_list = '';
+  foreach ($table_schemas as $table => $schema) {
+    $table_list .= "    '$table',\n";
+  }
+  print (
+    "/**\n" .
+    " * Lists the table names in the v" . $version . " chado schema\n" .
+    " *\n" .
+    " * @return\n" .
+    " *    An array containing all of the table names\n" .
+    " *\n" .
+    " * @ingroup tripal_chado_v" . $version . "_schema_api\n" .
+    " *\n" .
+    " */\n" .
+    "function tripal_core_chado_get_v" . $safe_version . "_tables() {\n" .
+    "  \$tables = array(\n" .
+    "$table_list" .
+    "  );\n" .
+    "  return \$tables;\n" .
+    "}\n"
+  );
+}

+ 0 - 161
tripal_chado/api/get_FKs.php

@@ -1,161 +0,0 @@
-<?php
-/**
- * @file
- * This script will add FK relatinsions to an existing schema API array for each
- * Chado table.  It requires Chado is installed in a 'chado' schema of
- * the drupal database.  It also requires existing schema hooks for
- * version of Chado.  The goal is to use the output of this script to
- * update the existing schema hooks.  Redirect the output of this script to
- * a file and then replace the existing schema API include file (e.g.
- * tripal_chado.schema_v1.2.api.inc).  Be sure to check it before replacing
- *
- * This script requires a single argument (-v) which is the Chado version.
- *
- * Example usage in drupal directory root:
- *
- * php ./sites/all/modules/tripal/tripal_chado/api/get_FKs.php -v 1.11 > \
- *   ./sites/all/modules/tripal/tripal_chado/apitripal_chado.schema_v1.11.api.inc.new
- *
- * php ./sites/all/modules/tripal/tripal_chado/api/get_FKs.php -v 1.2 > \
- *   ./sites/all/modules/tripal/tripal_chado/api/tripal_chado.schema_v1.2.api.inc.new
- */
-
-$arguments = getopt("v:");
-
-if (isset($arguments['v'])) {
-  $drupal_base_url = parse_url('http://www.example.com');
-  $_SERVER['HTTP_HOST'] = $drupal_base_url['host'];
-  $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF'];
-  $_SERVER['REMOTE_ADDR'] = NULL;
-  $_SERVER['REQUEST_METHOD'] = NULL;
-
-  require_once 'includes/bootstrap.inc';
-  drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
-
-  $version = $arguments['v'];
-  get_chado_fk_relationships($version);
-}
-
-/**
- * Builds the FK relationships array in the database.
- *
- * This function does the actual work of determining the foreign key
- * relationships from the database and creating the schema file.
- */
-function get_chado_fk_relationships($version) {
-
-  // convert the version to a form suitable for function names
-  $v = $version;
-  $v = preg_replace("/\./","_",$v);
-
-  $tables = chado_get_table_names();
-  $sql ="
-    SELECT
-        tc.constraint_name, tc.table_name, kcu.column_name,
-        ccu.table_name AS foreign_table_name,
-        ccu.column_name AS foreign_column_name
-    FROM
-        information_schema.table_constraints AS tc
-        JOIN information_schema.key_column_usage AS kcu ON tc.constraint_name = kcu.constraint_name
-        JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name
-    WHERE constraint_type = 'FOREIGN KEY' AND tc.table_name=:table_name
-  ";
-
-  // iterate through the tables and get the foreign keys
-  print "<?php
-/* @file: This file contains default schema definitions for all chado v$version tables
- *        to be used by other function. Specifically these functions are used
- *        by the tripal_chado select/insert/update API functions and by
- *        the Tripal Views module.
- *
- *        These schema definitions can be augmented by another modules
- *        (specifically to add missing definitions) by implementing
- *        hook_chado_schema_v" . $v . "_<table name>().
- *
- * @defgroup tripal_schema_api Core Module Schema API
- * @{
- * Provides an application programming interface (API) for describing Chado tables.
- * This API consists of a set of functions, one for each table in Chado.  Each
- * function simply returns a Drupal style array that defines the table.
- *
- * Because Drupal 6 does not handle foreign key (FK) relationships, however FK
- * relationships are needed to for Tripal Views.  Therefore, FK relationships
- * have been added to the schema defintitions below.
- *
- * The functions provided in this documentation should not be called as is, but if you need
- * the Drupal-style array definition for any table, use the following function
- * call:
- *
- *   \$table_desc = chado_get_schema(\$table)
- *
- * where the variable \$table contains the name of the table you want to
- * retireve.  The chado_get_schema function determines the appropriate version of
- * Chado and uses the Drupal hook infrastructure to call the appropriate
- * hook function to retrieve the table schema.
- *
- * @}
- * @ingroup tripal_api
- */
-";
-  $referring = array();
-  $tables_def = array();
-  foreach ($tables as $table) {
-
-    // get the existing table array
-    $table_arr = chado_get_schema($table);
-
-    if (empty($table_arr)) {
-       print "ERROR: empty table definition $table\n";
-       continue;
-    }
-
-    // add the table name to the array
-    $table_arr['table'] = $table;
-
-    // get the foreign keys and add them to the array
-    $fks = db_query($sql, array(':table_name' => $table));
-    foreach ($fks as $fk) {
-      $table_arr['foreign keys'][$fk->foreign_table_name]['table'] = $fk->foreign_table_name;
-      $table_arr['foreign keys'][$fk->foreign_table_name]['columns'][$fk->column_name] = $fk->foreign_column_name;
-      $reffering[$fk->foreign_table_name][] = $table;
-    }
-    $tables_def[] = $table_arr;
-  }
-
-  // now add in the referring tables and print
-  foreach ($tables_def as $table_arr) {
-    $table = $table_arr['table'];
-
-    // add in the referring tables
-    $table_referring = array_unique($reffering[$table]);
-    $table_arr['referring_tables'] = $table_referring;
-
-    // reformat the array to be more legible
-    $arr = var_export($table_arr, 1);
-    $arr = preg_replace("/\n\s+array/","array", $arr); // move array( to previous line
-    $arr = preg_replace("/\n/","\n  ", $arr); // add indentation
-    $arr = preg_replace("/true/","TRUE", $arr); // add indentation
-    $arr = preg_replace("/false/","FALSE", $arr); // add indentation
-    $arr = preg_replace("/array \(/","array(", $arr); // add indentation
-
-      // print out the new Schema API function for this table
-print "/**
- * Implements hook_chado_schema_v".$v."_".$table."()
- * Purpose: To describe the structure of '$table' to tripal
- * @see chado_insert_record()
- * @see chado_update_record()
- * @see chado_select_record()
- *
- * @return
- *    An array describing the '$table' table
- *
- * @ingroup tripal_chado_v".$version."_schema_api
- *
- */
-function tripal_chado_chado_schema_v".$v."_".$table."() {
-  \$description =  $arr;
-  return \$description;
-}
-";
-  }
-}

+ 2 - 0
tripal_chado/api/tripal_chado.query.api.inc

@@ -937,6 +937,8 @@ function chado_update_record($table, $match, $values, $options = NULL) {
  */
 function chado_delete_record($table, $match, $options = NULL) {
 
+  $print_errors = (isset($options['print_errors'])) ? $options['print_errors'] : FALSE;
+
   if (!is_array($match)) {
     tripal_report_error('tripal_chado', TRIPAL_ERROR,
       'Cannot pass non array as values for matching.', array());

+ 1 - 1
tripal_chado/includes/fields/chado_base__dbxref_id.inc

@@ -285,7 +285,7 @@ function theme_chado_base__dbxref_id_widget($variables) {
  * @param $base_table
  * @param $record
  */
-function chado_base__dbxref_id_field_load($field, $entity, $base_table, $record) {
+function chado_base__dbxref_id_load($field, $entity, $base_table, $record) {
 
   $field_name = $field['field_name'];
   $field_type = $field['type'];

+ 1 - 1
tripal_chado/includes/fields/chado_feature__md5checksum.inc

@@ -76,7 +76,7 @@ function chado_feature__md5checksum_widget_validate($element, &$form_state) {
  * @param $entity
  * @param $record
  */
-function chado_feature__md5checksum_field_load($field, $entity, $record) {
+function chado_feature__md5checksum_load($field, $entity, $record) {
   $field_name = $field['field_name'];
   if ($record and property_exists($record, 'md5checksum')) {
     $entity->{$field_name}['und'][] = array('value' => $record->md5checksum);

+ 1 - 1
tripal_chado/includes/fields/chado_linker__prop_adder.inc

@@ -44,7 +44,7 @@ function chado_linker__prop_adder_widget(&$widget, $form, $form_state,
     '#type' => 'textfield',
     '#description' => t("Please enter the type of property that you want to
         add.  As you type, suggestions will be provided."),
-    '#autocomplete_path' => "admin/tripal/storage/term/",
+    '#autocomplete_path' => "admin/tripal/storage/chado/auto_name/cvterm/",
   );
   $widget['kvproperty_adder_link'] = array(
     '#type' => 'item',

+ 0 - 10
tripal_chado/includes/fields/chado_linker__synonym.inc

@@ -30,16 +30,6 @@ function chado_linker__synonym_formatter(&$element, $entity_type, $entity, $fiel
 }
 /**
  *
- * @param unknown $field_name
- * @param unknown $widget
- * @param unknown $form
- * @param unknown $form_state
- * @param unknown $field
- * @param unknown $instance
- * @param unknown $langcode
- * @param unknown $items
- * @param unknown $delta
- * @param unknown $element
  */
 function chado_linker__synonym_widget(&$widget, $form, $form_state, $field,
     $instance, $langcode, $items, $delta, $element) {

+ 6 - 6
tripal_chado/includes/tripal_chado.fields.inc

@@ -377,10 +377,11 @@ function tripal_chado_field_widget_form(&$form, &$form_state, $field,
 
   $widget = $element;
 
-  $field_type = $instance['widget']['type'];
+  $field_name = $instance['field_name'];
+  $field_type = $field['type'];
   form_load_include($form_state, 'inc', 'tripal_chado', 'includes/fields/' . $field_type);
-  module_load_include('inc', 'tripal_chado', 'includes/fields/' . $field_type);
-  $function = $field_type;
+  module_load_include('inc', 'tripal_chado', 'includes/fields/' . $field_name);
+  $function = $field_type . '_widget';
   if (function_exists($function)) {
     $function($widget, $form, $form_state, $field, $instance, $langcode, $items, $delta, $element);
   }
@@ -932,8 +933,8 @@ function tripal_chado_add_bundle_fields_linker__dbxref_field($entity_type_name,
 
   // Initialize the field array.
   $field_info = array(
-    'field_type' => 'chado_base__dbxref_id',
-    'widget_type' => 'chado_base__dbxref_id_widget',
+    'field_type' => 'chado_linker__dbxref',
+    'widget_type' => 'chado_linker__dbxref_widget',
     'widget_settings' => array('display_label' => 1),
     'description' => '',
     'label' => 'Cross References',
@@ -1183,7 +1184,6 @@ function tripal_chado_add_bundle_fields_base__fields($entity_type_name, $bundle_
 function tripal_chado_field_validate($entity_type, $entity, $field, $instance,
     $langcode, $items, &$errors) {
 
-  //dpm($entity_type);
 
 }
 

+ 17 - 8
tripal_chado/includes/tripal_chado.setup.inc

@@ -201,12 +201,8 @@ function tripal_chado_prepare_chado() {
     // tripal_chado_load_obo_v1_2_id($obo_id);
     //// tripal_submit_obo_job(array('obo_id' => $obo_id));
 
-    // Load the sequence ontology.
-    $obo = tripal_get_obo(array('obo_name' => 'Sequence Ontology'));
-    if ($obo) {
-      print "Installing the Sequence Ontology... This may take a while...\n";
-      tripal_chado_load_obo_v1_2_id($obo->obo_id);
-    }
+    // Add the vocabularies used by the feature module.
+    tripal_feature_add_cvs();
 
     // Add the materialized view.
     tripal_feature_add_organism_count_mview();
@@ -216,8 +212,12 @@ function tripal_chado_prepare_chado() {
     tripal_feature_add_tripal_gffcds_temp_table();
     tripal_feature_add_tripal_gffprotein_temp_table();
 
-    // Add the vocabularies used by the feature module.
-    tripal_feature_add_cvs();
+    // Load the sequence ontology.
+    $obo = tripal_get_obo(array('obo_name' => 'Sequence Ontology'));
+    if ($obo) {
+      print "Installing the Sequence Ontology... This may take a while...\n";
+      tripal_chado_load_obo_v1_2_id($obo->obo_id);
+    }
 
     // Set the default vocabularies.
     tripal_set_default_cv('feature', 'type_id', 'sequence');
@@ -419,6 +419,7 @@ function tripal_stock_add_organism_count_mview() {
     'table' => $view_name,
     'fields' => array(
       'organism_id' => array(
+        'size' => 'big',
         'type' => 'int',
         'not null' => TRUE,
       ),
@@ -442,6 +443,7 @@ function tripal_stock_add_organism_count_mview() {
         'not null' => TRUE,
       ),
       'cvterm_id' => array(
+        'size' => 'big',
         'type' => 'int',
         'not null' => TRUE,
       ),
@@ -696,6 +698,7 @@ function tripal_library_add_mview_library_feature_count(){
     'description' => $comment,
     'fields' => array(
       'library_id' => array(
+        'size' => 'big',
         'type' => 'int',
         'not null' => TRUE,
       ),
@@ -1364,6 +1367,7 @@ function tripal_feature_add_organism_count_mview() {
     'table' => $view_name,
     'fields' => array(
       'organism_id' => array(
+        'size' => 'big',
         'type' => 'int',
         'not null' => TRUE,
       ),
@@ -1387,6 +1391,7 @@ function tripal_feature_add_organism_count_mview() {
         'not null' => TRUE,
       ),
       'cvterm_id' => array(
+        'size' => 'big',
         'type' => 'int',
         'not null' => TRUE,
       ),
@@ -1569,10 +1574,12 @@ function tripal_analysis_add_mview_analysis_organism() {
     'description' => $comment,
     'fields' => array(
       'analysis_id' => array(
+        'size' => 'big',
         'type' => 'int',
         'not null' => TRUE,
       ),
       'organism_id' => array(
+        'size' => 'big',
         'type' => 'int',
         'not null' => TRUE,
       ),
@@ -1692,10 +1699,12 @@ function tripal_cv_add_cv_root_mview() {
         'not null' => TRUE,
       ),
       'cvterm_id' => array(
+        'size' => 'big',
         'type' => 'int',
         'not null' => TRUE,
       ),
       'cv_id' => array(
+        'size' => 'big',
         'type' => 'int',
         'not null' => TRUE,
       ),

+ 1 - 1
tripal_chado/includes/tripal_chado.term_storage.inc

@@ -106,7 +106,7 @@ function tripal_chado_vocab_select_term_form($form, &$form_state) {
         Sequence Ontology (SO)."),
     '#required'    => TRUE,
     '#default_value' => $term_name,
-    '#autocomplete_path' => "admin/tripal/storage/term/",
+    '#autocomplete_path' => "admin/tripal/storage/chado/auto_name/cvterm/",
   );
   $form['select_button'] = array(
     '#type' => 'submit',

+ 16 - 7
tripal_chado/tripal_chado.module

@@ -102,13 +102,6 @@ function tripal_chado_views_api() {
 function tripal_chado_menu() {
   $items = array();
 
-  $items['admin/tripal/storage/term/%/%'] = array(
-    'page callback' => 'tripal_autocomplete_cvterm',
-    'page arguments' => array(4, 5),
-    'access arguments' => array('administer content'),
-    'type' => MENU_CALLBACK,
-  );
-
   //////////////////////////////////////////////////////////////////////////////
   //                            Chado Storage Backend
   //////////////////////////////////////////////////////////////////////////////
@@ -157,6 +150,21 @@ function tripal_chado_menu() {
     'weight' => -99
   );
 
+  $items['admin/structure/bio-data/publish'] = array(
+    'title' => 'Publish Chado Content',
+    'description' => t('Publish data that is present in Chado but which does
+        not yet have a page on this site for viewing. In Tripal v2.0 or
+        earlier this was refered to as "syncing".'),    'page callback' => 'drupal_get_form',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('tripal_chado_publish_form'),
+    'access arguments' => array('administer tripal'),
+    'file' => 'includes/tripal_chado.publish.inc',
+    'file path' => drupal_get_path('module', 'tripal_chado'),
+    'type' => MENU_LOCAL_ACTION,
+    'weight' => 2
+  );
+
+
   //////////////////////////////////////////////////////////////////////////////
   //                       Materialized Views
   //////////////////////////////////////////////////////////////////////////////
@@ -473,6 +481,7 @@ function tripal_chado_menu() {
     'file path' => drupal_get_path('module', 'tripal_chado'),
     'type' => MENU_CALLBACK,
   );
+
   $items['admin/tripal/storage/chado/auto_name/pub/%'] = array(
     'page callback' => 'tripal_autocomplete_pub',
     'page arguments' => array(6),