From 606985b6841e6f22ebe773424ec625118b8ac5f5 Mon Sep 17 00:00:00 2001 From: April Rieger Date: Mon, 22 Jul 2024 15:20:03 -0700 Subject: [PATCH] update the works controller decorator to remove params in collections_service method on main --- .../hyrax/my/works_controller_decorator.rb | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/app/controllers/hyrax/my/works_controller_decorator.rb b/app/controllers/hyrax/my/works_controller_decorator.rb index c4305e5c7..d13968003 100644 --- a/app/controllers/hyrax/my/works_controller_decorator.rb +++ b/app/controllers/hyrax/my/works_controller_decorator.rb @@ -1,10 +1,11 @@ # frozen_string_literal: true # OVERRIDE Hyrax 3.6.0 to add custom sort fields while in the dashboard for works +# OVERRIDE Hyrax 3.5.0 to update collections_service method to remove all params module Hyrax module My - module WorksControllerDecorator + module WorksControllerClassDecorator def configure_facets configure_blacklight do |config| # clear facets copied from the CatalogController @@ -22,8 +23,20 @@ def configure_facets end end end + + module WorksControllerDecorator + # OVERRIDE FROM HYRAX: CAN REMOVE AT 4.0 + # https://github.com/samvera/hyrax/pull/5972 + def collections_service + cloned = clone + cloned.params = {} + Hyrax::CollectionsService.new(cloned) + end + end end end -Hyrax::My::WorksController.singleton_class.send(:prepend, Hyrax::My::WorksControllerDecorator) +Hyrax::My::WorksController.singleton_class.send(:prepend, Hyrax::My::WorksControllerClassDecorator) Hyrax::My::WorksController.configure_facets + +Hyrax::My::WorksController.prepend(Hyrax::My::WorksControllerDecorator)