Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

use inner join

Ivan Kuchine58a168119fe
diff --git a/app/models/custom_field/order_statements.rb b/app/models/custom_field/order_statements.rb
index d5ebe139b76..0ccb1c78af4 100644
--- a/app/models/custom_field/order_statements.rb
+++ b/app/models/custom_field/order_statements.rb
@@ -114,7 +114,7 @@ module CustomField::OrderStatements
(
SELECT #{columns}
FROM #{CustomOption.quoted_table_name} co_sort
- LEFT JOIN #{CustomValue.quoted_table_name} cv_sort
+ INNER JOIN #{CustomValue.quoted_table_name} cv_sort
ON cv_sort.value IS NOT NULL AND co_sort.id = cv_sort.value::bigint
WHERE #{cv_sort_only_custom_field_condition_sql}
#{limit}