-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Rework view filter query to take default values into account
When gathering rows that are visible in views we need to take rows into account that have no corresponding entry in the columns_TYPE tables. For those we can match the filter in PHP and include row ids from a left join where there is no entry. Taking an example of a yes/no selection: If the default value of a column doesn't match we end up using the same query as before for collecting row ids ... `id` IN (SELECT `row_id` FROM `oc_tables_row_cells_selection` WHERE (`column_id` = 7) AND (`value` LIKE '"false"')) ... If the default value matches, we need to include those that do not have an entry ... `id` IN (SELECT `row_id` FROM `oc_tables_row_cells_selection` WHERE (`column_id` = 7) AND (`value` LIKE '"false"')) OR `id` IN (select sl.id from oc_tables_row_sleeves sl LEFT JOIN oc_tables_row_cells_selection se ON sl.id = se.row_id AND se.column_id = 7 WHERE se.id IS NULL) ... Signed-off-by: Julius Härtl <[email protected]>
- Loading branch information
1 parent
67948ab
commit 83238bb
Showing
1 changed file
with
74 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters