Using host_params in parameters leads to @Safemode doesn't allow to access 'host_params' on #<Safemode::ScopeObject>@
|Triaged:||Fixed in Releases:|
|Bugzilla link:||Found in Releases:|
<%= host_params('blabla') %> inside the host parameters
2. Rendering fails on
Safemode doesn't allow to access 'host_params' on #<Safemode::ScopeObject>
- Fixes #20931 - unify parameters and templates renderer
Before this patch, we used separate renderer for the parameters. This
caused issues when introducing more dsl methods for the templates that
we want to use in the parameters as well. Also, by the time of writing
the original SafeRenderer, there was no Renderer available.
After doing so, I was hitting issue with recursion, as
`Renderer.host_param` was using `@host.params` while the @host.params
was trying to render the params, that could include the `host_param`
call again, which lead to endless loop. After simplifying the
`HostParams` methods, it is possible to achieve this.
I also noticed that we were rendering only the inherited params and not
the non-inherited once. I've fixed this bug also as part of this patch.
Last but not least, due to the fact that we were using the
host_inherited_params for multiple purposes, we were rendering it also
when showing the host form, which was not even needed.