From fb640354803bedaf5d5091fde5ce4b055850c302 Mon Sep 17 00:00:00 2001 From: James Smith Date: Thu, 3 Oct 2024 15:50:54 +0100 Subject: [PATCH] Fix error browsing collections with library filter resolves #2847 --- app/controllers/collections_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/collections_controller.rb b/app/controllers/collections_controller.rb index 86816a138..8be474ebb 100644 --- a/app/controllers/collections_controller.rb +++ b/app/controllers/collections_controller.rb @@ -8,7 +8,7 @@ class CollectionsController < ApplicationController def index @models = filtered_models @filters @collections = policy_scope(Collection) - @collections = @collections.tree_both(Collection.find_param(@filters[:collection]).id || nil, @models.pluck(:collection_id).uniq) unless @filters.empty? + @collections = @collections.tree_both(Collection.find_param(@filters[:collection]).id || nil, @models.pluck(:collection_id).uniq) unless @filters[:collection].nil? @tags, @unrelated_tag_count = generate_tag_list(@models, @filter_tags) @tags, @kv_tags = split_key_value_tags(@tags)