Commit bca64c83 authored by merlinofchaos's avatar merlinofchaos

#512650 by sdboyer: Multiple many to one arguments on the same relationship...

#512650 by sdboyer: Multiple many to one arguments on the same relationship were not relationship safe.
parent ea2032e7
......@@ -52,6 +52,7 @@ Views 2.x-dev
o #510920 by apanag: Add set_current_page() method to view class.
o #337741 by joachim: Allow profile fields to have "link to user" option.
o #534680 by dagmar: Visual indicator if checkbox will expand options.
o #512650 by sdboyer: Multiple many to one arguments on the same relationship were not relationship safe.
Views 2.6
Bugs fixed:
......
......@@ -572,10 +572,9 @@ class views_many_to_one_helper {
while ($r_join->left_table != $base_table) {
$r_join = views_get_table_join($r_join->left_table, $base_table);
}
// If we found that there are tables in between, add the relationship.
if ($r_join->table != $join->table) {
$relationship = $this->handler->query->add_relationship($this->handler->table, $r_join, $r_join->table, $this->handler->relationship);
$relationship = $this->handler->query->add_relationship($this->handler->table . '_' . $r_join->table, $r_join, $r_join->table, $this->handler->relationship);
}
// And now add our table, using the new relationship if one was used.
......@@ -855,7 +854,7 @@ function views_get_timezone() {
$already_set = true;
}
}
}
return $timezone;
}
......
......@@ -201,6 +201,11 @@ class views_query {
$alias = $alias_base . '_' . $count++;
}
// Make sure this join is adjusted for our relationship.
if ($link_point && isset($this->relationships[$link_point])) {
$join = $this->adjust_join($join, $link_point);
}
// Add the table directly to the queue to avoid accidentally marking
// it.
$this->table_queue[$alias] = array(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment