File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
lib/decidim/term_customizer/context Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -13,13 +13,15 @@ def resolve!
13
13
# E.g. at the participatory process controller the
14
14
# `decidim.current_participatory_space` environment variable has not
15
15
# been set. Therefore, we need to fetch it directly from the
16
- # controller using its private method.
17
- @space =
18
- if controller . respond_to? ( :current_participatory_space , true )
19
- controller . send ( :current_participatory_space )
20
- else
21
- env [ "decidim.current_participatory_space" ]
22
- end
16
+ # controller using its private method. In some edge cases this may not
17
+ # be implemented (https://github.com/mainio/decidim-module-term_customizer/issues/28)
18
+ # in which case we do not have access to the participatory space.
19
+ if controller . respond_to? ( :current_participatory_space , true )
20
+ @space = controller . try (
21
+ :current_participatory_space
22
+ )
23
+ end
24
+ @space ||= env [ "decidim.current_participatory_space" ]
23
25
24
26
@component = env [ "decidim.current_component" ]
25
27
end
You can’t perform that action at this time.
0 commit comments