Browse Source

Fixed problem with sequences

Stephen Ficklin 8 years ago
parent
commit
00251c7720

+ 5 - 9
tripal_chado/includes/TripalFields/data__sequence/data__sequence_widget.inc

@@ -22,18 +22,14 @@ class data__sequence_widget extends ChadoFieldWidget {
 
     // Get the field defaults.
     $residues = '';
-    if (count($items) > 0 and array_key_exists('chado-feature__residues', $items[0])) {
-      $residues = $items[0]['chado-feature__residues'];
+    if (count($items) > 0 and array_key_exists('value', $items[0])) {
+      $residues = $items[0]['value'];
     }
     if (array_key_exists('values', $form_state)) {
-      //$residues = tripal_chado_get_field_form_values($field_name, $form_state, 0, 'feature__residues');
+      $residues = $form_state['values'][$field_name][$langcode][$delta]['value'];
     }
 
     $widget['value'] = array(
-      '#type' => 'value',
-      '#value' => array_key_exists($delta, $items) ? $items[$delta]['value'] : '',
-    );
-    $widget['chado-feature__residues'] = array(
       '#type' => 'textarea',
       '#title' => $element['#title'],
       '#description' => $element['#description'],
@@ -53,10 +49,10 @@ class data__sequence_widget extends ChadoFieldWidget {
     $field_name = $this->field['field_name'];
 
     // Remove any white spaces.
-    $residues = isset($form_state['values'][$field_name][$langcode][$delta]['chado-feature__residues']) ? $form_state['values'][$field_name][$langcode][$delta]['chado-feature__residues'] : '';
+    $residues = isset($form_state['values'][$field_name][$langcode][$delta]['value']) ? $form_state['values'][$field_name][$langcode][$delta]['value'] : '';
     if ($residues) {
       $residues = preg_replace('/\s/', '', $residues);
-      $form_state['values'][$field_name][$langcode][$delta]['chado-feature__residues'] = $residues;
+      $form_state['values'][$field_name][$langcode][$delta]['value'] = $residues;
     }
   }
 }

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

@@ -42,7 +42,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
   // is an insert and we need to set the type_id if the table supports it.