From 72ea73988cac0ae520eeef84ac7e868051c9c3eb Mon Sep 17 00:00:00 2001 From: Ted Johansson Date: Tue, 18 Jul 2023 11:07:01 +0800 Subject: [PATCH] DEV: Add missing report filter type in bookmarks report (#22616) Adding a filter without a type parameter has been deprecated for the last three years, and was marked for removal in 2.9.0. During this time we have had a few deprecation warnings in logs coming from Reports::Bookmarks. The fallback was to set the type to the name of the filter. This change just passes the type (same as name) explicitly instead, and removes the deprecation fallback. --- app/models/concerns/reports/bookmarks.rb | 2 +- app/models/report.rb | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/app/models/concerns/reports/bookmarks.rb b/app/models/concerns/reports/bookmarks.rb index 3dac869021e..ab6ba95610d 100644 --- a/app/models/concerns/reports/bookmarks.rb +++ b/app/models/concerns/reports/bookmarks.rb @@ -8,7 +8,7 @@ module Reports::Bookmarks report.icon = "bookmark" category_filter = report.filters.dig(:category) - report.add_filter("category", default: category_filter) + report.add_filter("category", type: "category", default: category_filter) report.data = [] Bookmark diff --git a/app/models/report.rb b/app/models/report.rb index ca79d36bc93..d5e9240369e 100644 --- a/app/models/report.rb +++ b/app/models/report.rb @@ -129,14 +129,6 @@ class Report end def add_filter(name, options = {}) - if options[:type].blank? - options[:type] = name - Discourse.deprecate( - "#{name} filter should define a `:type` option. Temporarily setting type to #{name}.", - drop_from: "2.9.0", - ) - end - available_filters[name] = options end