Browse Source

Fixed unaliases stock_id in stockprop filter

laceysanderson 14 years ago
parent
commit
5561ffbc18
1 changed files with 3 additions and 3 deletions
  1. 3 3
      tripal_core/views/handlers/views_handler_filter_stockprop_id.inc

+ 3 - 3
tripal_core/views/handlers/views_handler_filter_stockprop_id.inc

@@ -54,11 +54,11 @@ class views_handler_filter_stockprop_id extends views_handler_filter {
 
 	function query () {
 		if (preg_match('/IS NOT NULL/', $this->options['operator'])) {
-			$new_where_sql = "stock_id IN (SELECT stock_id FROM stockprop WHERE type_id=".$this->type.")";
+			$new_where_sql = "stock.stock_id IN (SELECT stockprop.stock_id FROM stockprop WHERE stockprop.type_id=".$this->type.")";
 		} elseif (preg_match('/IS NULL/', $this->options['operator'])) {
-			$new_where_sql = "stock_id NOT IN (SELECT stock_id FROM stockprop WHERE type_id=".$this->type.")";
+			$new_where_sql = "stock.stock_id NOT IN (SELECT stockprop.stock_id FROM stockprop WHERE stockprop.type_id=".$this->type.")";
 		} else {
-			$new_where_sql = "stock_id IN (SELECT stock_id FROM stockprop WHERE type_id=".$this->type." AND value".$this->operator."'".$this->value."')";
+			$new_where_sql = "stock.stock_id IN (SELECT stockprop.stock_id FROM stockprop WHERE stockprop.type_id=".$this->type." AND stockprop.value".$this->operator."'".$this->value."')";
 		}
 		$this->query->add_where($this->options['group'], $new_where_sql);
 	}