From 368ae5ce6af037fed38236cd831067e7c9ccf3c9 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Mon, 12 May 2025 22:23:16 -0500 Subject: [PATCH] Handle case where no params are sent because nothing is checked --- app/controllers/concerns/day_timelines_scoped.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/controllers/concerns/day_timelines_scoped.rb b/app/controllers/concerns/day_timelines_scoped.rb index 597e35f7d..f08167179 100644 --- a/app/controllers/concerns/day_timelines_scoped.rb +++ b/app/controllers/concerns/day_timelines_scoped.rb @@ -4,12 +4,19 @@ module DayTimelinesScoped included do include FilterScoped + before_action :normalize_collection_params before_action :restore_collections_filter_from_cookie before_action :set_day_timeline after_action :save_collections_filter_to_cookie end private + def normalize_collection_params + if params[:collection_ids].blank? && !params[:clear_filter] + params[:collection_ids] = [] + end + end + def restore_collections_filter_from_cookie if params[:clear_filter] delete_collections_filter_cookie