#1248454 by dereine: Relationship handlers should respect real field
authorDaniel Wehner
Fri, 9 Sep 2011 21:37:46 +0000 (23:37 +0200)
committerDaniel Wehner
Fri, 9 Sep 2011 21:37:46 +0000 (23:37 +0200)
handlers/views_handler_relationship.inc

index 8f16b09..bcab8b9 100644 (file)
@@ -43,7 +43,9 @@ class views_handler_relationship extends views_handler {
       $this->table = $this->definition['relationship table'];
     }
     if (isset($this->definition['relationship field'])) {
-      $this->field = $this->definition['relationship field'];
+      // Set both real_field and field so custom handler
+      // can rely on the old field value.
+      $this->real_field = $this->field = $this->definition['relationship field'];
     }
   }
 
@@ -110,7 +112,7 @@ class views_handler_relationship extends views_handler {
     $def['table'] = $this->definition['base'];
     $def['field'] = $base_field;
     $def['left_table'] = $this->table_alias;
-    $def['left_field'] = $this->field;
+    $def['left_field'] = $this->real_field;
     if (!empty($this->options['required'])) {
       $def['type'] = 'INNER';
     }