Browse Source

Fixed merge issues.

Lacey Sanderson 6 years ago
parent
commit
0e5a04cd48

+ 2 - 18
tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship.inc

@@ -403,7 +403,6 @@ class sbo__relationship extends ChadoField {
     $object_type = $entity->{$field_name}['und'][$delta]['value']['local:relationship_object']['rdfs:type'];
     $object_name = $entity->{$field_name}['und'][$delta]['value']['local:relationship_object']['schema:name'];
 
-
     // Remember the current entity could be either the subject or object!
     // Example: The genetic_marker, MARKER1 , derives from the sequence_variant, VARIANT1.
     // The above relationship will be shown both on marker and variant pages
@@ -464,22 +463,6 @@ class sbo__relationship extends ChadoField {
       return;
     }
 
-    // Not all tables have the columns named 'subject_id' and 'object_id'.
-    // some have variations on that name and we need to determine what they are.
-    $fkeys = $schema['foreign keys'];
-    $subject_id_key = 'subject_id';
-    $object_id_key = 'object_id';
-    foreach ($fkeys as $fktable => $details) {
-      foreach ($details['columns'] as $fkey_lcolumn => $fkey_rcolumn) {
-        if (preg_match('/^subject_.*id/', $fkey_lcolumn)) {
-          $subject_id_key = $fkey_lcolumn;
-        }
-        if (preg_match('/^object_.*id/', $fkey_lcolumn)) {
-          $object_id_key = $fkey_lcolumn;
-        }
-      }
-    }
-
     // Set some defaults for the empty record.
     $entity->{$field_name}['und'][0] = array(
       'value' => '',
@@ -949,7 +932,8 @@ class sbo__relationship extends ChadoField {
     $type_id = $item['chado-' . $field_table . '__type_id'];
     $type_id = isset($item['type_id']) ? $item['chado-' . $field_table . '__type_id'] : $type_id;
     $type_name = isset($item['type_name']) ? $item['type_name'] : '';
-    $subject_name = isset($item['subject_name']) ? $items['subject_name'] : '';
+    $voc_id = isset($item['vocabulary']) ? $item['vocabulary'] : '';
+    $subject_name = isset($item['subject_name']) ? $item['subject_name'] : '';
     $object_name = isset($item['object_name']) ? $item['object_name'] : '';
 
     // If the row is empty then just continue, there's nothing to validate.

+ 0 - 1
tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship_widget.inc

@@ -347,7 +347,6 @@ class sbo__relationship_widget extends ChadoFieldWidget {
     //------------
     // If the row is empty then skip this one, there's nothing to validate.
     if (!($type_id || $type_name) && !$subject_name && !$object_name) {
-      print "HERE; Type Name: $type_name, Type ID: $type_id, Subject Name: $subject_name, Object Name: $object_name\n";
       return;
     }