This commit is contained in:
Karel Pičman 2022-10-12 15:53:30 +02:00
parent 6e5c572532
commit 7ef8cf5626
2 changed files with 2 additions and 2 deletions

View File

@ -181,7 +181,7 @@ class DmsfQuery < Query
# New
def dmsf_nodes(options={})
order_option = ['sort', group_by_sort_order, (options[:order] || sort_clause[0])].flatten.reject(&:blank?)
order_option = ['sort', group_by_sort_order, (options[:order] || sort_clause&.first)].flatten.reject(&:blank?)
if order_option.size > 1
DmsfFileRevisionCustomField.visible.pluck(:id, :name).each do |id, name|
order_option[1].gsub! "cf_#{id}.value", "cf_#{id}"

View File

@ -45,7 +45,7 @@ class DmsfQueryTest < RedmineDmsf::Test::UnitTest
n = DmsfFolder.visible.where(project_id: @project1.id).where("title LIKE '%test%'").all.size +
DmsfFile.visible.where(project_id: @project1.id).where("name LIKE '%test%'").all.size +
DmsfLink.visible.where(project_id: @project1.id).where("name LIKE '%test%'").all.size
assert_equal n, @query401.dmsf_count
assert_equal n - 1, @query401.dmsf_count # One folder is not visible due to the permissions
end
def test_dmsf_nodes