Closed aitorlb closed 5 years ago
This is "fixed" by 5d7dca16af4f4cb049f1f573f6c5eefd8b427fc0 (the not crashing part).
Hard to fix "properly" without that core patch but there is a workaround for this issue:
# frozen_string_literal: true
# lib/term_customizer_custom_controller_context.rb
class TermCustomizerCustomControllerContext < Decidim::TermCustomizer::Context::ControllerContext
def resolve!
env = data[:headers].env
controller = env["action_controller.instance"]
@organization = env["decidim.current_organization"]
if controller.respond_to?(:current_consultation)
consultation = controller.send(:current_consultation)
@space = consultation
@component = env["decidim.current_component"]
return
end
super
end
end
# config/initializers/term_customizer.rb
require "term_customizer_custom_controller_context"
Decidim::TermCustomizer.controller_context_class = TermCustomizerCustomControllerContext
Describe the bug
Consultations frontend crashes when using
decidim-consultations
withdecidim-term_customizer
.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Should not crash.
Screenshots
If applicable, add screenshots to help explain your problem.
Stacktrace
If applicable, add the error stacktrace to help explain your problem.