Przeglądaj źródła

Merge branch '7.x-3.x' into 7.x-3.x-dashboard

Stephen Ficklin 7 lat temu
rodzic
commit
4715f747c6

+ 9 - 4
tripal/includes/TripalEntityController.inc

@@ -503,6 +503,11 @@ class TripalEntityController extends EntityAPIController {
           $field = field_info_field($field_name);
           $field_id = $field['id'];
 
+          // Add this field to the entity with default value.
+          if (!isset($queried_entities[$id]->$field_name)) {
+            $queried_entities[$id]->$field_name = array();
+          }
+
           // Options used for the field_attach_load function.
           $options = array();
           $options['field_id'] = $field['id'];
@@ -516,7 +521,7 @@ class TripalEntityController extends EntityAPIController {
             $cache_data = cache_get($cfid, 'cache_field');
             if (!empty($cache_data)) {
               $queried_entities[$id]->$field_name = $cache_data->data;
-              $queried_entities[$id]->$field_name['#processed'] = TRUE;
+              $queried_entities[$id]->{$field_name}['#processed'] = TRUE;
               continue;
             }
           }
@@ -531,7 +536,7 @@ class TripalEntityController extends EntityAPIController {
               if ($field_cache) {
                 cache_set($cfid, $entity->$field_name, 'cache_field');
               }
-              $queried_entities[$id]->$field_name['#processed'] = TRUE;
+              $queried_entities[$id]->{$field_name}['#processed'] = TRUE;
             }
           }
           // If we don't have a list of fields then load them all, but only
@@ -551,7 +556,7 @@ class TripalEntityController extends EntityAPIController {
                // hook to add the necessary prefixes to the field for ajax
                // loading.
                $queried_entities[$id]->$field_name['und'][0]['value'] = '';
-               $queried_entities[$id]->$field_name['#processed'] = FALSE;
+               $queried_entities[$id]->{$field_name}['#processed'] = FALSE;
             }
             else {
               $function($this->entityType, array($entity->id => $queried_entities[$id]),
@@ -560,7 +565,7 @@ class TripalEntityController extends EntityAPIController {
               if ($field_cache) {
                 cache_set($cfid, $entity->$field_name, 'cache_field');
               }
-              $queried_entities[$id]->$field_name['#processed'] = TRUE;
+              $queried_entities[$id]->{$field_name}['#processed'] = TRUE;
             }
           }
         }

+ 1 - 1
tripal/includes/tripal.entity.inc

@@ -333,7 +333,7 @@ function tripal_entity_view($entity, $type, $view_mode, $langcode) {
         $class = '';
         if (array_key_exists('auto_attach', $instance['settings']) and
             $instance['settings']['auto_attach'] == FALSE and
-            $entity->$child_name['#processed'] == FALSE) {
+            $entity->{$child_name}['#processed'] == FALSE) {
           // If the field is empty then try to use ajax to load it.
           $items = field_get_items('TripalEntity', $entity, $child_name);
           if (count($items) == 0 or empty($items[0]['value'])) {

+ 1 - 0
tripal_chado/api/tripal_chado.api.inc

@@ -161,6 +161,7 @@ function tripal_chado_publish_records($values, $job_id = NULL) {
   // Perform the query.
   $sql = $select . $from . $where;
   $records = chado_query($sql, $args);
+
   $transaction = db_transaction();
 
   print "\nNOTE: publishing records is performed using a database transaction. \n" .

+ 1 - 1
tripal_chado/includes/TripalFields/so__cds/so__cds.inc

@@ -62,7 +62,7 @@ class so__cds extends ChadoField {
     );
     $feature = chado_expand_var($feature, 'table', 'featureloc', $options);
     $featurelocs = $feature->featureloc->feature_id;
-    return;
+
     foreach($featurelocs as $featureloc){
       // Generate a CDS sequence if one exsits for this feature alignment.
       $cds_sequence = tripal_get_feature_sequences(

+ 2 - 3
tripal_chado/includes/tripal_chado.field_storage.inc

@@ -1171,7 +1171,7 @@ function tripal_chado_field_storage_bundle_mapping_form_submit($form,
   $default = array(
     'table' => '',
     'has_all' => 'No',
-    'use_cvterm' => 'cv',
+    'use_cvterm' => '',
     'cv_id' => '',
     'use_linker' => 'No',
     'use_prop' => 'No',
@@ -1218,7 +1218,7 @@ function tripal_chado_field_storage_bundle_mapping_form_submit($form,
 
   // If the user selected to use the cvterm table then we have to
   // handle it specially.
-  if ($default['use_cvterm']) {
+  if ($default['use_cvterm'] == 'cv' and !empty($default['cv_id'])) {
     $storage_args['data_table'] = $default['table'];
     $storage_args['type_id'] = $form_state['values']['selected_cvterm_id'];
     $storage_args['type_value'] = '';
@@ -1226,7 +1226,6 @@ function tripal_chado_field_storage_bundle_mapping_form_submit($form,
       $storage_args['type_value'] = $default['cv_id'];
     }
     $storage_args['type_column'] = '';
-
     return;
   }