Explorar o código

Fixed create empty object bug

spficklin %!s(int64=12) %!d(string=hai) anos
pai
achega
76b65d1857
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      tripal_core/api/tripal_core.api.inc

+ 3 - 0
tripal_core/api/tripal_core.api.inc

@@ -1997,6 +1997,9 @@ function tripal_core_expand_chado_vars($object, $type, $to_expand, $table_option
           // if the object returned is NULL then handle that
           else {
             if (count($foreign_table_desc['foreign keys'][$base_table]['columns']) > 1) {
+              if (!is_object($object->{$foreign_table})) {
+                $object->{$foreign_table} = new stdClass();
+              }
               $object->{$foreign_table}->{$left} = NULL;
             }
             else {