Procházet zdrojové kódy

Quick bug fix: in tripal_create_entity_type() vocab usage wasn't set when the vocabulary usage already existed.

Lacey Sanderson před 9 roky
rodič
revize
9fa1d8b253
1 změnil soubory, kde provedl 11 přidání a 2 odebrání
  1. 11 2
      tripal_entities/api/tripal_entities.api.inc

+ 11 - 2
tripal_entities/api/tripal_entities.api.inc

@@ -127,10 +127,13 @@ function tripal_create_entity_type($cvterm, &$error = '') {
       $vocab_usage->type_table = $values['type_table'];
       $vocab_usage->field = $values['field'];
     }
+    else {
+      $vocab_usage = (object) $values;
+    }
   }
   // The organism table does not have a type_id so we won't ever find
   // a record for it in the tripal_cv_defaults table.
-  else if ($cvterm->name == 'organism') {
+  elseif ($cvterm->name == 'organism') {
     $values = array(
       'vocabulary_id' => $vocab->vocabulary_id,
       'data_table' => 'organism',
@@ -150,10 +153,13 @@ function tripal_create_entity_type($cvterm, &$error = '') {
       $vocab_usage->type_table = $values['type_table'];
       $vocab_usage->field = $values['field'];
     }
+    else {
+      $vocab_usage = (object) $values;
+    }
   }
   // The analysis table does not have a type_id so we won't ever find
   // a record for it in the tripalcv_defaults table.
-  else if ($cvterm->name == 'analysis') {
+  elseif ($cvterm->name == 'analysis') {
     $values = array(
       'vocabulary_id' => $vocab->vocabulary_id,
       'data_table' => 'analysis',
@@ -173,6 +179,9 @@ function tripal_create_entity_type($cvterm, &$error = '') {
       $vocab_usage->type_table = $values['type_table'];
       $vocab_usage->field = $values['field'];
     }
+    else {
+      $vocab_usage = (object) $values;
+    }
   }
   // If there is no default table then we have an error, and we should
   // set a variable so that the form can help the user deal with the problem.