Browse Source

Updating default entity titles

Stephen Ficklin 8 years ago
parent
commit
be77d369e7

+ 5 - 3
tripal_chado/includes/tripal_chado.entity.inc

@@ -178,10 +178,12 @@ function tripal_chado_tripal_default_title_format($entity, $available_tokens) {
   $column = $mapped_table->chado_field;
   $cvterm_id = $mapped_table->cvterm->cvterm_id;
 
+  // TODO: the tables should not be hardcoded, but a the unique constraint should
+  // be used to create default titles
   // For organism titles  we want the genus and species with no comma separation.
   if ($table == 'organism') {
     $format[] = array(
-      'format' => '[organism__genus] [organism__species]',
+      'format' => '[taxrank__genus] [taxrank__species]',
       'weight' => -5
     );
   }
@@ -193,7 +195,7 @@ function tripal_chado_tripal_default_title_format($entity, $available_tokens) {
   }
   if ($table == 'feature') {
     $format[] = array(
-      'format' => '[feature__name]',
+      'format' => '[schema__name]',
       'weight' => -5
     );
   }
@@ -373,4 +375,4 @@ function tripal_chado_entity_view_alter(&$build) {
       }
     }
   }
-}
+}

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

@@ -681,7 +681,7 @@ function tripal_chado_bundle_create_instances($entity_type, $bundle) {
     $field = field_info_field($details['field_name']);
     if ($field and array_key_exists('bundles', $field) and
         array_key_exists('TripalEntity', $field['bundles']) and
-        in_array($bundle_name, $field['bundles']['TripalEntity'])) {
+        in_array($bundle->name, $field['bundles']['TripalEntity'])) {
       continue;
     }
     // Create the field instance.