فهرست منبع

Merge branch '6.x-1.x' of git.drupal.org:sandbox/spficklin/1337878 into 6.x-1.x

spficklin 12 سال پیش
والد
کامیت
194e70bf9a

+ 3 - 3
tripal_featuremap/tripal_featuremap.views.inc

@@ -32,11 +32,11 @@ function tripal_featuremap_views_data()  {
 
   if (module_exists('tripal_views')) {
     $tables = array(
-      'map'
+      'featuremap'
     );
     foreach ($tables as $tablename) {
       $priority = 9;
-      
+
       // check to see if the table is integrated. If it is then integrate it's
       // corresponding 'chado_[table]' table.
       if (!tripal_views_is_integrated($tablename, $priority)) {
@@ -64,7 +64,7 @@ function tripal_featuremap_views_data()  {
       'mapprop'
     );
     foreach ($tables as $tablename) {
-      $priority = 9;     
+      $priority = 9;
       if (!tripal_views_is_integrated($tablename, $priority)) {
         $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename, FALSE, $priority);
         tripal_views_integration_add_entry($table_integration_array);

+ 13 - 1
tripal_views/api/tripal_views.api.inc

@@ -155,6 +155,12 @@ function tripal_views_is_lightest_priority_setup($setup_id, $table_name) {
 function tripal_views_integration_add_entry($defn_array) {
   $no_errors = TRUE;
 
+  if (empty($defn_array['table'])) {
+    watchdog('tripal_views','Recieved integration with no tablename: %defn', array('%defn' => print_r($defn_array,TRUE)), WATCHDOG_WARNING);
+    $no_errors = FALSE;
+    return $no_errors;
+  }
+
   // First insert into tripal_views
   $view_record = array(
     'table_name' => $defn_array['table'],
@@ -420,7 +426,7 @@ function tripal_views_integrate_all_chado_tables() {
 
   $tables = tripal_core_get_chado_tables(TRUE);
   foreach ($tables as $tablename) {
-  
+
     $priority = 10;
     if (!tripal_views_is_integrated($tablename, $priority)) {
       $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename, TRUE, $priority);
@@ -570,6 +576,12 @@ function tripal_views_add_node_relationship_to_chado_table_integration($defn_arr
   $primary_key = $defn_array['table'] . '_id';
   $chado_linking = 'chado_' . $defn_array['table'];
 
+  if (empty($defn_array['table'])) {
+    watchdog('tripal_views','Tried to add a node=>chado relationship for an empty table defn: %defn',
+      array('%defn' => print_r($defn_array,TRUE)),WATCHDOG_WARNING);
+    return FALSE;
+  }
+
   // Add table.primary_key => chado_table.primary key join to $defn_array
   $integrations[$defn_array['table']]['fields'][$primary_key]['joins'][$chado_linking] = array(
     'table' => $chado_linking,

+ 1 - 0
tripal_views/views/handlers/tripal_views_handler_filter_select_string.inc

@@ -101,6 +101,7 @@ class tripal_views_handler_filter_select_string extends chado_views_handler_filt
       if (!$max_length) {
         $max_length = 40;
       }
+      $options = array();
       if ($this->options['optional']) {
         //$options['<select '.$this->table.'>'] = '--None--';
         $options['All'] = '--Any--';