Prechádzať zdrojové kódy

Added chado_linker_expression field. Fixed some bug for chado_linker_contact and chado_linker_featureloc

ccheng 8 rokov pred
rodič
commit
5fb78b90ed

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

@@ -35,11 +35,11 @@ class chado_linker__contact extends TripalField {
   public function attach_info($entity_type, $bundle, $settings) {
     $field_info = array();
 
-    $table_name = $target['data_table'];
-    $type_table = $target['type_table'];
-    $type_field = $target['field'];
-    $cv_id      = $target['cv_id'];
-    $cvterm_id  = $target['cvterm_id'];
+    $table_name = $settings['data_table'];
+    $type_table = $settings['type_table'];
+    $type_field = $settings['field'];
+    $cv_id      = $settings['cv_id'];
+    $cvterm_id  = $settings['cvterm_id'];
 
     // If the linker table does not exists then we don't want to add attach.
     $contact_table = $table_name . '_contact';
@@ -96,7 +96,7 @@ class chado_linker__contact extends TripalField {
 
   }
 
-  public function load($field, $entity, $details) {
+  public function load($field, $entity, $record) {
     $field_name = $field['field_name'];
     $field_type = $field['type'];
     $field_table = $field['settings']['chado_table'];
@@ -104,10 +104,12 @@ class chado_linker__contact extends TripalField {
 
     // Get the FK that links to the base record.
     $schema = chado_get_schema($field_table);
+    $base_table = $record['record']->tablename;
     $pkey = $schema['primary key'][0];
     $fkey_lcolumn = key($schema['foreign keys'][$base_table]['columns']);
     $fkey_rcolumn = $schema['foreign keys'][$base_table]['columns'][$fkey_lcolumn];
 
+
     // Set some defaults for the empty record.
     $entity->{$field_name}['und'][0] = array(
       'value' => '',

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

@@ -131,7 +131,7 @@ class chado_linker__featureloc extends TripalField {
          $strand = '+';
       }
       // if this is a match then make the other location
-      if(array_key_exists($alignment, 'right_feature')){
+      if(array_key_exists('right_feature', $alignment)){
         $rstrand = '.';
         if ($alignment['right_strand'] == -1) {
           $rstrand = '-';