Browse Source

Cleaned up unused formatterSettings function in all fields, and fixed data__accession field

Stephen Ficklin 7 years ago
parent
commit
7d748e442e
21 changed files with 99 additions and 268 deletions
  1. 1 1
      tripal/tripal.module
  2. 4 0
      tripal_chado/api/modules/tripal_chado.db.api.inc
  3. 27 16
      tripal_chado/includes/TripalFields/data__accession/data__accession.inc
  4. 57 67
      tripal_chado/includes/TripalFields/data__accession/data__accession_widget.inc
  5. 1 8
      tripal_chado/includes/TripalFields/data__protein_sequence/data__protein_sequence_formatter.inc
  6. 0 7
      tripal_chado/includes/TripalFields/data__sequence_coordinates/data__sequence_coordinates_formatter.inc
  7. 0 7
      tripal_chado/includes/TripalFields/data__sequence_length/data__sequence_length_formatter.inc
  8. 0 7
      tripal_chado/includes/TripalFields/go__gene_expression/go__gene_expression_formatter.inc
  9. 0 8
      tripal_chado/includes/TripalFields/ogi__location_on_map/ogi__location_on_map_formatter.inc
  10. 0 8
      tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference_formatter.inc
  11. 0 8
      tripal_chado/includes/TripalFields/sbo__phenotype/sbo__phenotype_formatter.inc
  12. 6 16
      tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship.inc
  13. 0 8
      tripal_chado/includes/TripalFields/schema__additional_type/schema__additional_type_formatter.inc
  14. 0 8
      tripal_chado/includes/TripalFields/schema__alternate_name/schema__alternate_name_formatter.inc
  15. 0 8
      tripal_chado/includes/TripalFields/schema__publication/schema__publication_formatter.inc
  16. 0 56
      tripal_chado/includes/TripalFields/sio__annotation/sio__annotation_formatter.inc
  17. 0 9
      tripal_chado/includes/TripalFields/sio__references/sio__references_formatter.inc
  18. 0 8
      tripal_chado/includes/TripalFields/so__genotype/so__genotype_formatter.inc
  19. 0 8
      tripal_chado/includes/TripalFields/so__transcript/so__transcript_formatter.inc
  20. 0 8
      tripal_chado/includes/TripalFields/taxrank__infraspecific_taxon/taxrank__infraspecific_taxon_formatter.inc
  21. 3 2
      tripal_chado/includes/tripal_chado.field_storage.inc

+ 1 - 1
tripal/tripal.module

@@ -665,7 +665,7 @@ function tripal_form_alter(&$form, $form_state, $form_id) {
         // If we have no widgets then here's not a form for this field so just
         // remove it.
         if ($total_widgets == 0) {
-          //unset($form[$child]);
+          unset($form[$child]);
         }
       }
     }

+ 4 - 0
tripal_chado/api/modules/tripal_chado.db.api.inc

@@ -393,6 +393,10 @@ function tripal_insert_db($values, $options = array()) {
  *    - version: (Optional) The version of the database reference
  *    - description: (Optional) A description of the database reference
  *
+ * @return
+ *   The newly inserted dbxref as an object, similar to that returned by
+ *   the chado_select_record() function.
+ *
  * @ingroup tripal_chado_api
  */
 function tripal_insert_dbxref($values) {

+ 27 - 16
tripal_chado/includes/TripalFields/data__accession/data__accession.inc

@@ -61,8 +61,6 @@ class data__accession extends ChadoField {
       'chado-' . $field_table . '__' . $field_column => '',
       'db_id' => '',
       'accession' => '',
-      'version' => '',
-      'description' => '',
     );
 
     // Get the primary dbxref record (if it's not NULL).  Because we have a
@@ -73,10 +71,8 @@ class data__accession extends ChadoField {
       $entity->{$field_name}['und'][0] = array(
         'value' => $dbxref->accession,
         'chado-' . $field_table . '__' . $field_column => $record->$field_column->$field_column,
-        'db_id'       => $dbxref->db_id->db_id,
-        'accession'   => $dbxref->accession,
-        'version'     => $dbxref->version,
-        'description' => $dbxref->description,
+        'db_id' => $dbxref->db_id->db_id,
+        'accession' => $dbxref->accession,
       );
     }
   }
@@ -85,21 +81,39 @@ class data__accession extends ChadoField {
    * @see ChadoField::query()
    */
   public function query($query, $condition) {
-    $chado_table = $this->instance['settings']['chado_table'];
-    $base_table = $this->instance['settings']['base_table'];
-    $bschema = chado_get_schema($base_table);
-    $bpkey = $bschema['primary key'][0];
-    $alias = 'dbx_linker';
+    $alias = $this->field['field_name'];
     $operator = $condition['operator'];
+    $field_table = $this->instance['settings']['chado_table'];
+    $field_column = $this->instance['settings']['chado_column'];
+
+    $field_term_id = $this->getFieldTermID();
+    $accession_term = tripal_get_chado_semweb_term($field_table, $field_column);
 
     // We don't offer any sub elements so the value coming in should
     // always be the field_name.
-    if ($condition['column'] == 'data__accession') {
+    if ($condition['column'] == $accession_term) {
       $this->queryJoinOnce($query, 'dbxref', 'DBX', "DBX.dbxref_id = base.dbxref_id");
       $query->condition("DBX.accession", $condition['value'], $operator);
     }
   }
 
+  public function queryOrder($query, $order) {
+    $alias = $this->field['field_name'];
+    $operator = $condition['operator'];
+    $field_table = $this->instance['settings']['chado_table'];
+    $field_column = $this->instance['settings']['chado_column'];
+
+    $field_term_id = $this->getFieldTermID();
+    $accession_term = tripal_get_chado_semweb_term($field_table, $field_column);
+
+    // We don't offer any sub elements so the value coming in should
+    // always be the field_name.
+    if ($order['column'] == $accession_term) {
+      $this->queryJoinOnce($query, 'dbxref', 'DBX', "DBX.dbxref_id = base.dbxref_id", "LEFT OUTER");
+      $query->orderBy("DBX.accession", $order['direction']);
+    }
+  }
+
   /**
    * @see TripalField::validate()
    */
@@ -113,11 +127,8 @@ class data__accession extends ChadoField {
 
     // Get the field values.
     foreach ($items as $delta => $values) {
-      $fk_val = $values['chado-' . $field_table . '__' . $field_column];
       $db_id = $values['db_id'];
       $accession = $values['accession'];
-      $version = $values['version'];
-      $description = $values['description'];
 
       // Make sure that if a database ID is provided that an accession is also
       // provided.  Here we use the form_set_error function rather than the
@@ -138,7 +149,7 @@ class data__accession extends ChadoField {
           'error' => 'chado_base__dbxref',
         );
       }
-      if (!$db_id and !$accession and ($version or $description)) {
+      if (!$db_id and !$accession) {
         $errors[$field_name][$delta]['und'][] = array(
           'message' => t("A database and the accession must both be provided for the primary cross reference."),
           'error' => 'chado_base__dbxref',

+ 57 - 67
tripal_chado/includes/TripalFields/data__accession/data__accession_widget.inc

@@ -18,29 +18,23 @@ class data__accession_widget extends ChadoFieldWidget {
     $field_column = $this->instance['settings']['chado_column'];
 
     // Get the field defaults.
-    $fk_val = '';
+    $dbxref_id = '';
     $db_id = '';
     $accession = '';
-    $version = '';
-    $description = '';
 
     // If the field already has a value then it will come through the $items
     // array.  This happens when editing an existing record.
     if (count($items) > 0 and array_key_exists($delta, $items)) {
-      $fk_val = $items[$delta]['chado-' . $field_table . '__' . $field_column];
+      $dbxref_id = $items[$delta]['chado-' . $field_table . '__' . $field_column];
       $db_id = $items[$delta]['db_id'];
       $accession = $items[$delta]['accession'];
-      $version = $items[$delta]['version'];
-      $description = $items[$delta]['description'];
     }
 
     // Check $form_state['values'] to see if an AJAX call set the values.
     if (array_key_exists('values', $form_state)) {
-      $fk_val = isset($form_state['values'][$field_name]['und'][$delta]['chado-' . $field_table . '__' . $field_column]) ? $form_state['values'][$field_name]['und'][$delta]['chado-' . $field_table . '__' . $field_column] : '';
+      $dbxref_id = isset($form_state['values'][$field_name]['und'][$delta]['chado-' . $field_table . '__' . $field_column]) ? $form_state['values'][$field_name]['und'][$delta]['chado-' . $field_table . '__' . $field_column] : '';
       $db_id = isset($form_state['values'][$field_name]['und'][$delta]['db_id']) ? $form_state['values'][$field_name]['und'][$delta]['db_id'] : '';
       $accession = isset($form_state['values'][$field_name]['und'][$delta]['accession']) ? $form_state['values'][$field_name]['und'][$delta]['accession'] : '';
-      $version = isset($form_state['values'][$field_name]['und'][$delta]['version']) ? $form_state['values'][$field_name]['und'][$delta]['version'] : '';
-      $description = isset($form_state['values'][$field_name]['und'][$delta]['description']) ? $form_state['values'][$field_name]['und'][$delta]['description'] : '';
     }
 
     $schema = chado_get_schema('dbxref');
@@ -52,12 +46,12 @@ class data__accession_widget extends ChadoFieldWidget {
 
     $widget['value'] = array(
       '#type' => 'value',
-      '#value' => array_key_exists($delta, $items) ? $items[$delta]['value'] : '',
+      '#value' => $dbxref_id,
     );
 
     $widget['chado-' . $field_table . '__' . $field_column] = array(
       '#type' => 'value',
-      '#default_value' => $fk_val,
+      '#default_value' => $dbxref_id,
     );
 
     $widget['db_id'] = array(
@@ -82,38 +76,19 @@ class data__accession_widget extends ChadoFieldWidget {
       '#size' => 15,
       '#autocomplete_path' => 'admin/tripal/storage/chado/auto_name/dbxref/' . $db_id,
       '#ajax' => array(
-        'callback' => "tripal_chado_dbxref_widget_form_ajax_callback",
+        'callback' => "data__accession_widget_form_ajax_callback",
         'wrapper' => "$field_name-dbxref--db-id",
         'effect' => 'fade',
         'method' => 'replace'
       ),
       '#disabled' => $db_id ? FALSE : TRUE,
     );
-    $widget['version'] = array(
-      '#type' => 'textfield',
-      '#title' => t('Version'),
-      '#default_value' => $version,
-      '#maxlength' => array_key_exists('length', $schema['fields']['version']) ? $schema['fields']['version']['length'] : 255,
-      '#size' => 5,
-      '#disabled' => $db_id ? FALSE : TRUE,
-    );
-    $widget['description'] = array(
-      '#type' => 'textfield',
-      '#title' => t('Description'),
-      '#default_value' => $description,
-      '#size' => 20,
-      '#disabled' => $db_id ? FALSE : TRUE,
-    );
-    $widget['links'] = array(
-      '#type' => 'item',
-      '#markup' => l('Add a new database', 'admin/tripal/loaders/chado_db/add', array('attributes' => array('target' => '_blank')))
-    );
   }
 
   /**
    * @see TripalFieldWidget::submit()
    */
-  public function submit($form, &$form_state, $entity_type, $entity, $langcode, $delta) {
+  public function validate($element, $form, &$form_state, $langcode, $delta) {
     $field_name = $this->field['field_name'];
     $settings = $this->field['settings'];
     $field_name = $this->field['field_name'];
@@ -121,26 +96,55 @@ class data__accession_widget extends ChadoFieldWidget {
     $field_table = $this->instance['settings']['chado_table'];
     $field_column = $this->instance['settings']['chado_column'];
 
-    $fk_val = isset($form_state['values'][$field_name][$langcode][$delta]['chado-' . $field_table . '__' . $field_column]) ? $form_state['values'][$field_name][$langcode][$delta]['chado-' . $field_table . '__' . $field_column] : '';
-    $db_id = isset($form_state['values'][$field_name][$langcode][$delta]['db_id']) ? $form_state['values'][$field_name][$langcode][$delta]['db_id'] : '';
-    $accession = isset($form_state['values'][$field_name][$langcode][$delta]['accession']) ? $form_state['values'][$field_name][$langcode][$delta]['accession'] : '';
-    if (!$accession) {
-      $accession = $form_state['values'][$field_name][$langcode][$delta]['value'];
-    }
-    $version = isset($form_state['values'][$field_name][$langcode][$delta]['version']) ? $form_state['values'][$field_name][$langcode][$delta]['version'] : '';
+    $dbxref_id = $form_state['values'][$field_name]['und'][$delta]['chado-' . $field_table . '__dbxref_id'];
+    $db_id = $form_state['values'][$field_name]['und'][$delta]['db_id'];
+    $accession = $form_state['values'][$field_name]['und'][$delta]['accession'];
 
     // If user did not select a database, we want to remove dbxref_id from the
-    // field.
+    // field. We use '__NULL__' because this field is part of the base table
+    // and this tells the Chado backend to insert a null rather than an empty
+    // string.
     if (!$db_id) {
-      $form_state['values'][$field_name][$langcode][$delta]['chado-' . $field_table . '__dbxref_id'] = '__NULL__';
+      $form_state['values'][$field_name]['und'][$delta]['chado-' . $field_table . '__dbxref_id'] = '__NULL__';
     }
     // If the dbxref_id does not match the db_id + accession then the user
     // has selected a new dbxref record and we need to update the hidden
     // value accordingly.
     if ($db_id and $accession) {
       $dbxref = chado_generate_var('dbxref', array('db_id' => $db_id, 'accession' => $accession));
-      if ($dbxref and $dbxref->dbxref_id != $fk_val) {
-        $form_state['values'][$field_name][$langcode][$delta]['chado-' . $field_table . '__dbxref_id'] = $dbxref->dbxref_id;
+      if ($dbxref and $dbxref->dbxref_id != $dbxref_id) {
+        $form_state['values'][$field_name]['und'][$delta]['chado-' . $field_table . '__dbxref_id'] = $dbxref->dbxref_id;
+        $form_state['values'][$field_name]['und'][$delta]['value'] = $dbxref->dbxref_id;
+      }
+    }
+  }
+
+  /**
+   * @see TripalFieldWidget::submit()
+   */
+  public function submit($form, &$form_state, $entity_type, $entity, $langcode, $delta) {
+    $field_name = $this->field['field_name'];
+    $settings = $this->field['settings'];
+    $field_name = $this->field['field_name'];
+    $field_type = $this->field['type'];
+    $field_table = $this->instance['settings']['chado_table'];
+    $field_column = $this->instance['settings']['chado_column'];
+
+    $dbxref_id = $form_state['values'][$field_name]['und'][$delta]['chado-' . $field_table . '__dbxref_id'];
+    $db_id = $form_state['values'][$field_name]['und'][$delta]['db_id'];
+    $accession = $form_state['values'][$field_name]['und'][$delta]['accession'];
+
+    // If the accession doesn't exist then add it.
+    if ($db_id and $accession) {
+      $dbxref = chado_generate_var('dbxref', array('db_id' => $db_id, 'accession' => $accession));
+      if (!$dbxref) {
+        $values = array(
+          'db_id' => $db_id,
+          'accession' => $accession,
+        );
+        $dbxref = tripal_insert_dbxref($values);
+        $form_state['values'][$field_name]['und'][$delta]['chado-' . $field_table . '__dbxref_id'] = $dbxref->dbxref_id;
+        $form_state['values'][$field_name]['und'][$delta]['value'] = $dbxref->dbxref_id;
       }
     }
   }
@@ -157,13 +161,6 @@ class data__accession_widget extends ChadoFieldWidget {
         <div class=\"primary-dbxref-widget-item\">" .
           drupal_render($element['accession']) . "
         </div>
-        <div class=\"primary-dbxref-widget-item\">" .
-          drupal_render($element['version']) . "
-        </div>
-        <div class=\"primary-dbxref-widget-item\">" .
-          drupal_render($element['description']) . "
-        </div>
-        <div class=\"primary-dbxref-widget-links\">" . drupal_render($element['links']) . "</div>
       </div>
     ";
 
@@ -172,7 +169,6 @@ class data__accession_widget extends ChadoFieldWidget {
       '#value' => '',
       '#description' => $element['#description'],
       '#children' => $layout,
-      //    '#attributes' => array('class' => $classes),
     );
 
     return theme('fieldset', array('element' => $fieldset));
@@ -186,23 +182,17 @@ function data__accession_widget_form_ajax_callback($form, $form_state) {
 
   $instance = $form['#instance'];
   $field_name = $form_state['triggering_element']['#parents'][0];
-  $field = field_info_field($field_name);
-  $field_type = $field['type'];
-  $field_table = $instance['settings']['chado_table'];
-  $field_column = $instance['settings']['chado_column'];
-  $field_prefix = 'chado-' . $field_table . '__' . $field_column;
-
-  //   $db_id = tripal_chado_get_field_form_values($field_name, $form_state, 0, $field_prefix . '--db_id');
-  //   $accession = tripal_chado_get_field_form_values($field_name, $form_state, 0, $field_prefix . '--accession');
+  $dbxref_id = $form_state['input'][$field_name]['und'][0]['chado-' . $field_table . '__dbxref_id'];
+  $db_id = $form_state['input'][$field_name]['und'][0]['db_id'];
+  $accession = $form_state['input'][$field_name]['und'][0]['accession'];
+
+  // If we don't have a match then this must be new accession. Because
+  // this is a database defined access we will automatically add the
+  // accession.
   if ($db_id and $accession) {
-    $values = array(
-      'db_id' => $db_id,
-      'accession' => $accession,
-    );
-    $options = array('is_duplicate' => TRUE);
-    $has_duplicate = chado_select_record('dbxref', array('*'), $values, $options);
-    if (!$has_duplicate) {
-      drupal_set_message('The selected cross reference is new and will be added for future auto completions.', 'warning');
+    $dbxref = chado_generate_var('dbxref', array('db_id' => $db_id, 'accession' => $accession));
+    if (!$dbxref) {
+      drupal_set_message('The accession provided does not exist in the database and will be added.', 'warning');
     }
   }
 

+ 1 - 8
tripal_chado/includes/TripalFields/data__protein_sequence/data__protein_sequence_formatter.inc

@@ -7,15 +7,8 @@ class data__protein_sequence_formatter extends ChadoFieldFormatter {
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('data__protein_sequence');
 
-
   /**
-   *
-   * @param unknown $element
-   * @param unknown $entity_type
-   * @param unknown $entity
-   * @param unknown $langcode
-   * @param unknown $items
-   * @param unknown $display
+   * @see TripalFieldFormatter::view()
    */
   public function view(&$element, $entity_type, $entity, $langcode, $items, $display) {
     $content = 'There is no protein sequence.';

+ 0 - 7
tripal_chado/includes/TripalFields/data__sequence_coordinates/data__sequence_coordinates_formatter.inc

@@ -7,13 +7,6 @@ class data__sequence_coordinates_formatter extends ChadoFieldFormatter {
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('data__sequence_coordinates');
 
-  /**
-   *
-   * @see TripalFieldFormatter::settingsForm()
-   */
-  public function settingsForm($view_mode, $form, &$form_state) {
-
-  }
 
   /**
    *

+ 0 - 7
tripal_chado/includes/TripalFields/data__sequence_length/data__sequence_length_formatter.inc

@@ -7,13 +7,6 @@ class data__sequence_length_formatter extends ChadoFieldFormatter {
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('data__sequence_length');
 
-  /**
-   *
-   * @see TripalFieldFormatter::settingsForm()
-   */
-  public function settingsForm($view_mode, $form, &$form_state) {
-
-  }
 
   /**
    *

+ 0 - 7
tripal_chado/includes/TripalFields/go__gene_expression/go__gene_expression_formatter.inc

@@ -7,13 +7,6 @@ class go__gene_expression_formatter extends ChadoFieldFormatter {
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('go__gene_expression');
 
-  /**
-   *
-   * @see TripalFieldFormatter::settingsForm()
-   */
-  public function settingsForm($view_mode, $form, &$form_state) {
-
-  }
 
   /**
    *

+ 0 - 8
tripal_chado/includes/TripalFields/ogi__location_on_map/ogi__location_on_map_formatter.inc

@@ -7,14 +7,6 @@ class ogi__location_on_map_formatter extends ChadoFieldFormatter {
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('ogi__location_on_map');
 
-  /**
-   *
-   * @see TripalFieldFormatter::settingsForm()
-   */
-  public function settingsForm($view_mode, $form, &$form_state) {
-
-  }
-
   /**
    *
    * @see TripalFieldFormatter::view()

+ 0 - 8
tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference_formatter.inc

@@ -7,14 +7,6 @@ class sbo__database_cross_reference_formatter extends ChadoFieldFormatter {
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('sbo__database_cross_reference');
 
-  /**
-   *
-   * @see TripalFieldFormatter::settingsForm()
-   */
-  public function settingsForm($view_mode, $form, &$form_state) {
-
-  }
-
   /**
    *
    * @see TripalFieldFormatter::view()

+ 0 - 8
tripal_chado/includes/TripalFields/sbo__phenotype/sbo__phenotype_formatter.inc

@@ -7,14 +7,6 @@ class sbo__phenotype_formatter extends ChadoFieldFormatter {
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('sbo__phenotype');
 
-  /**
-   *
-   * @see TripalFieldFormatter::settingsForm()
-   */
-  public function settingsForm($view_mode, $form, &$form_state) {
-
-  }
-
   /**
    *
    * @see TripalFieldFormatter::view()

+ 6 - 16
tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship.inc

@@ -84,6 +84,12 @@ class sbo__relationship extends ChadoField {
         'searchable' => FALSE,
         'type' => 'string',
         'elements' => array(
+          'SIO:000493' => array(
+            'searchable' => FALSE,
+            'label' => 'Relationship Clause',
+            'help' => 'An English phrase describing the relationships.',
+            'sortable' => FALSE,
+          ),
           'local:relationship_subject' => array(
             'searchable' => FALSE,
             'name' => 'relationship_subject',
@@ -92,7 +98,6 @@ class sbo__relationship extends ChadoField {
             'elements' => array(
               'rdfs:type' => array(
                 'searchable' => TRUE,
-                'name' => 'subject_type',
                 'label' => 'Relationship Subject Type',
                 'help' => 'The subject\'s data type in a relationship clause',
                 'operations' => array('eq', 'ne', 'contains', 'starts'),
@@ -100,7 +105,6 @@ class sbo__relationship extends ChadoField {
               ),
               'schema:name' => array(
                 'searchable' => TRUE,
-                'name' => 'subject_name',
                 'label' => 'Relationship Subject Name',
                 'help' => 'The subject\'s name in a relationship clause',
                 'operations' => array('eq', 'ne', 'contains', 'starts'),
@@ -270,20 +274,6 @@ class sbo__relationship extends ChadoField {
       )
     );
 
-    // Get the primary key for the subject and object.
-//     $subject_id = $relationship->$subject_id_key->$subject_pkey;
-//     $sentity_id = chado_get_record_entity_by_table($subject_fkey_table, $subject_id);
-//     if ($sentity_id) {
-//       $entity->{$field_name}['und'][$delta]['value']['local:relationship_subject']['entity'] = 'TripalEntity:' . $sentity_id;
-//     }
-
-//     // See if an entity exists for the object.
-//     $object_id = $relationship->$object_id_key->$object_pkey;
-//     $sentity_id = chado_get_record_entity_by_table($object_fkey_table, $object_id);
-//     if ($sentity_id) {
-//       $entity->{$field_name}['und'][$delta]['value']['local:relationship_object']['entity'] = 'TripalEntity:' . $sentity_id;
-//     }
-
     // If the subject or object have a unqiuename then add that in for refernce.
     if (property_exists($relationship->$subject_id_key, 'uniquename')) {
       $entity->{$field_name}['und'][$delta]['value']['local:relationship_subject']['data:0842'] = $relationship->$subject_id_key->uniquename;;

+ 0 - 8
tripal_chado/includes/TripalFields/schema__additional_type/schema__additional_type_formatter.inc

@@ -7,14 +7,6 @@ class schema__additional_type_formatter extends ChadoFieldFormatter {
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('schema__additional_type');
 
-  /**
-   *
-   * @see TripalFieldFormatter::settingsForm()
-   */
-  public function settingsForm($view_mode, $form, &$form_state) {
-
-  }
-
   /**
    *
    * @see TripalFieldFormatter::view()

+ 0 - 8
tripal_chado/includes/TripalFields/schema__alternate_name/schema__alternate_name_formatter.inc

@@ -7,14 +7,6 @@ class schema__alternate_name_formatter extends ChadoFieldFormatter {
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('schema__alternate_name');
 
-  /**
-   *
-   * @see TripalFieldFormatter::settingsForm()
-   */
-  public function settingsForm($view_mode, $form, &$form_state) {
-
-  }
-
   /**
    *
    * @see TripalFieldFormatter::view()

+ 0 - 8
tripal_chado/includes/TripalFields/schema__publication/schema__publication_formatter.inc

@@ -7,14 +7,6 @@ class schema__publication_formatter extends ChadoFieldFormatter {
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('schema__publication');
 
-  /**
-   *
-   * @see TripalFieldFormatter::settingsForm()
-   */
-  public function settingsForm($view_mode, $form, &$form_state) {
-
-  }
-
   /**
    *
    * @see TripalFieldFormatter::view()

+ 0 - 56
tripal_chado/includes/TripalFields/sio__annotation/sio__annotation_formatter.inc

@@ -7,62 +7,6 @@ class sio__annotation_formatter extends ChadoFieldFormatter {
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('chado_linker__cvterm');
 
-
-  /**
-   *
-   * @see TripalFieldFormatter::settingsForm()
-   */
-  public function settingsForm($view_mode, $form, &$form_state) {
-    $headers = array('Term', 'Definition', 'Is Not', 'Reference');
-    $rows = array();
-
-
-    $chado_table = $this->instance['settings']['chado_table'];
-    foreach ($items as $delta => $item) {
-      if ($item['chado-' . $chado_table . '__cvterm_id']) {
-        $cvterm = chado_generate_var('cvterm', array('cvterm_id' => $item['chado-' . $chado_table . '__cvterm_id']));
-        $dbxref = $cvterm->dbxref_id;
-
-        // Build the accession.
-        $accession = $dbxref->db_id->name . ':' . $dbxref->accession;
-        if ($dbxref->db_id->urlprefix) {
-          $accession = l($accession, tripal_get_dbxref_url($dbxref), array('attributes' => array('target' => '_blank')));
-        }
-
-        $rows[] = array(
-          $accession,
-          $cvterm->definition,
-          $item['chado-' . $chado_table . '__is_not'] ? 'Yes' : '',
-          '',
-        );
-      }
-    }
-
-    // the $table array contains the headers and rows array as well as other
-    // 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,
-      'attributes' => array(
-        'id' => "$chado_table-table-terms",
-        'class' => 'tripal-data-table'
-      ),
-      'caption' => '',
-      'sticky' => FALSE,
-      'colgroups' => array(),
-      'empty' => 'There are no annotations of this type',
-    );
-
-    if (count($items) > 0) {
-      $element[0] = array(
-        '#type' => 'markup',
-        '#markup' => theme_table($table),
-      );
-    }
-  }
-
   /**
    *
    * @see TripalFieldFormatter::view()

+ 0 - 9
tripal_chado/includes/TripalFields/sio__references/sio__references_formatter.inc

@@ -7,15 +7,6 @@ class sio__references_formatter extends ChadoFieldFormatter {
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('sio__references');
 
-
-  /**
-   *
-   * @see TripalFieldFormatter::settingsForm()
-   */
-  public function settingsForm($view_mode, $form, &$form_state) {
-
-  }
-
   /**
    *
    * @see TripalFieldFormatter::view()

+ 0 - 8
tripal_chado/includes/TripalFields/so__genotype/so__genotype_formatter.inc

@@ -7,14 +7,6 @@ class so__genotype_formatter extends ChadoFieldFormatter {
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('so__genotype');
 
-  /**
-   *
-   * @see TripalFieldFormatter::settingsForm()
-   */
-  public function settingsForm($view_mode, $form, &$form_state) {
-
-  }
-
   /**
    *
    * @see TripalFieldFormatter::view()

+ 0 - 8
tripal_chado/includes/TripalFields/so__transcript/so__transcript_formatter.inc

@@ -7,14 +7,6 @@ class so__transcript_formatter extends ChadoFieldFormatter {
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('so__transcript');
 
-  /**
-   *
-   * @see TripalFieldFormatter::settingsForm()
-   */
-  public function settingsForm($view_mode, $form, &$form_state) {
-
-  }
-
   /**
    *
    * @see TripalFieldFormatter::view()

+ 0 - 8
tripal_chado/includes/TripalFields/taxrank__infraspecific_taxon/taxrank__infraspecific_taxon_formatter.inc

@@ -7,14 +7,6 @@ class taxrank__infraspecific_taxon_formatter extends ChadoFieldFormatter {
   // The list of field types for which this formatter is appropriate.
   public static $field_types = array('taxrank__infraspecific_taxon');
 
-  /**
-   *
-   * @see TripalFieldFormatter::settingsForm()
-   */
-  public function settingsForm($view_mode, $form, &$form_state) {
-
-  }
-
   /**
    *
    * @see TripalFieldFormatter::view()

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

@@ -43,6 +43,7 @@ function tripal_chado_field_storage_write($entity_type, $entity, $op, $fields) {
 
   // Convert the fields into a key/value list of fields and their values.
   $field_vals = tripal_chado_field_storage_write_merge_fields($fields, $entity_type, $entity);
+//dpm($field_vals);
 
   // First, write the record for the base table.  If we have a record id then
   // this is an update and we need to set the primary key.  If not, then this
@@ -627,8 +628,8 @@ function tripal_chado_field_storage_query($query) {
     } // end if ($sort['type'] == 'field') {
   } // end foreach ($query->order as $index => $sort) {
 
-//    dpm($cquery->__toString());
-//    dpm($cquery->getArguments());
+    dpm($cquery->__toString());
+    dpm($cquery->getArguments());
 
   $records = $cquery->execute();