diff --git a/libraries/joomla/database/query.php b/libraries/joomla/database/query.php index d533c0bfb7bc3..753f55d93108c 100644 --- a/libraries/joomla/database/query.php +++ b/libraries/joomla/database/query.php @@ -374,14 +374,14 @@ public function __toString() $query .= (string) $this->having; } - if ($this->order) + if ($this->union) { - $query .= (string) $this->order; + $query .= (string) $this->union; } - if ($this->union) + if ($this->order) { - $query .= (string) $this->union; + $query .= (string) $this->order; } break;