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

Fix missing sortBy key to the export query

Oliver Günther0cae124fc7ea
diff --git a/app/models/exports/formatters/custom_field.rb b/app/models/exports/formatters/custom_field.rb
index ca9630b1a9c..153892c7f30 100644
--- a/app/models/exports/formatters/custom_field.rb
+++ b/app/models/exports/formatters/custom_field.rb
@@ -1,8 +1,6 @@
module Exports
module Formatters
class CustomField < Default
- ##
- # Checks if this column is applicable for this column
def self.apply?(attribute)
attribute.start_with?('cf_')
end
diff --git a/app/models/exports/formatters/default.rb b/app/models/exports/formatters/default.rb
index 69147968aa5..64318d49570 100644
--- a/app/models/exports/formatters/default.rb
+++ b/app/models/exports/formatters/default.rb
@@ -9,8 +9,6 @@ module Exports
@attribute = attribute
end
- ##
- # Checks if this column is applicable for this column
def self.apply?(_attribute)
false
end
diff --git a/app/models/projects/exports/query_exporter.rb b/app/models/projects/exports/query_exporter.rb
index 882bdecff36..5d08073583f 100644
--- a/app/models/projects/exports/query_exporter.rb
+++ b/app/models/projects/exports/query_exporter.rb
@@ -43,9 +43,11 @@ module Projects::Exports
def projects
@projects ||= query
- .results
- .page(page)
- .per_page(Setting.work_packages_export_limit.to_i)
+ .results
+ .with_required_storage
+ .with_latest_activity
+ .page(page)
+ .per_page(Setting.work_packages_export_limit.to_i)
end
private
diff --git a/app/views/projects/_project_export_modal.html.erb b/app/views/projects/_project_export_modal.html.erb
index ab0b944a0d4..95db1de7891 100644
--- a/app/views/projects/_project_export_modal.html.erb
+++ b/app/views/projects/_project_export_modal.html.erb
@@ -45,7 +45,7 @@ See COPYRIGHT and LICENSE files for more details.
<ul class="op-export-options">
<% supported_export_formats.each do |key| %>
<li class="op-export-options--option">
- <% filter_params = safe_query_params ['filters'] %>
+ <% filter_params = safe_query_params ['filters', 'sortBy'] %>
<%= link_to url_for(action: 'index', format: key, **filter_params),
class: 'op-export-options--option-link' do %>
<%= op_icon("icon-big icon-export-#{key}") %>