#86385QueryBuilder restrictions break leftJoin
Description
All QueryBuilder restrictions append their restriction as “WHERE”. This breaks left joins if a joined row is deleted/hidden.
Example:
SELECT *
FROM pages
LEFT JOIN tt_content ON tt_content.pid = pages.uid
# added by restrictions
WHERE pages.deleted = 0 AND tt_content.deleted = 0
If there is a page with only deleted content elements than the entire page is removed from the result. The query should look like this
SELECT *
FROM pages
LEFT JOIN tt_content ON tt_content.pid = pages.uid AND tt_content.deleted = 0
WHERE pages.deleted = 0
In that example, if all content elements of a page are deleted, than the page is still selected but without content elements.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.