Przeglądaj źródła

Fixed a bug in the chado_expand_vars API function call. When a foreign key relationship existed with the same table twice (e.g. subject_id and object_id both map to feature_id in the feature_relationship table) then only one of the relationships would appear in the resulting object

Stephen Ficklin 12 lat temu
rodzic
commit
9001868cf7
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      tripal_core/tripal_core.api.inc

+ 3 - 1
tripal_core/tripal_core.api.inc

@@ -1263,7 +1263,9 @@ function tripal_core_expand_chado_vars($object, $type, $to_expand, $table_option
             // than once with the same table we want to alter the
             // array structure
             if (count($foreign_table_desc['foreign keys'][$base_table]['columns']) > 1) {
-              $object->{$foreign_table} = new stdClass();
+              if(!is_object($object->{$foreign_table})){
+                 $object->{$foreign_table} = new stdClass();
+              }
               $object->{$foreign_table}->{$left} = $foreign_object;
               $object->expanded = $to_expand;
             }