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

exclude empty values for list

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