[23814] Include subprojects in filter

With #4771, subprojects were no longer included in the query
results unless an explicit subproject filter is set.

This commit re-enables the `Setting.display_subprojects_work_packages?`
check.

https://community.openproject.com/work_packages/23814
pull/4830/head
Oliver Günther 8 years ago
parent f99d1a4b5d
commit 513f491256
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 3
      app/models/query.rb

@ -385,9 +385,10 @@ class Query < ActiveRecord::Base
elsif project
project_clauses << "#{Project.table_name}.id = %d" % project.id
end
with_subprojects = Setting.display_subprojects_work_packages? || !subproject_filter.nil?
project_clauses << WorkPackage.visible_condition(User.current,
project: project,
with_subprojects: !subproject_filter.nil?)
with_subprojects: with_subprojects)
project_clauses.join(' AND ')
end

Loading…
Cancel
Save