Parcourir la source

string field handler now deals with aggregated fields not using the aggregate join handler

Lacey Sanderson il y a 13 ans
Parent
commit
8d33b00e4b
1 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. 8 0
      base/tripal_core/views/handlers/chado_views_handler_field.inc

+ 8 - 0
base/tripal_core/views/handlers/chado_views_handler_field.inc

@@ -60,6 +60,14 @@ class chado_views_handler_field extends views_handler_field {
    */
    */
   function pre_render (&$values) {
   function pre_render (&$values) {
     
     
+    // further check the results to see if this field is a postgresql array
+    if (!$this->aggregated) {
+      if (preg_match('/^{.*}$/',$values[0]->{$this->field_alias})) {
+        $this->aggregated = TRUE;
+      }
+    }
+    
+    // Split Aggregated Results
     if ($this->aggregated) {
     if ($this->aggregated) {
       foreach($values as $k => $v) {
       foreach($values as $k => $v) {
         $values[$k]->{$this->field_alias} = $this->split_array_agg_results($v->{$this->field_alias});
         $values[$k]->{$this->field_alias} = $this->split_array_agg_results($v->{$this->field_alias});