Skip to content

Union once again #115

@csthomas

Description

@csthomas

Steps to reproduce the issue

Query with Union does not work at ll.

My example:

Expected result

Should work.

Actual result

System information (as much as possible)

Joomla 4.0-dev

Additional comments

Is something wrong with do it in the same way as in Joomla3?

I propose a fix:

diff --git a/src/DatabaseQuery.php b/src/DatabaseQuery.php
index 7ee91d0..e912e01 100644
--- a/src/DatabaseQuery.php
+++ b/src/DatabaseQuery.php
@@ -267,6 +267,16 @@ abstract class DatabaseQuery implements QueryInterface
                                        {
                                                $query .= (string) $this->having;
                                        }
+
+                                       if ($this->union)
+                                       {
+                                               $query .= (string) $this->union;
+                                       }
+
+                                       if ($this->unionAll)
+                                       {
+                                               $query .= (string) $this->unionAll;
+                                       }
                                }
 
                                if ($this->order)

Ping @mbabker

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions