Meta context variables denote those which have special meaning outside the context of the Jinjava template. In HubL, this includes variables like content.
If these are manually overridden, such as inside a set tag or a for tag, then the lose their special functionality. This is mirrored by the set of metaContextVariables which can have keys removed inside of a set tag or for tag.
If a meta context variable is removed and then an import tag is run, the meta context variable will re-appear due to the prepareContext method getting run again, which is used to re-add meta context variables.
This PR adds a new method getComputedMetaContextVariables() and deprecates the old getMetaContextVariables() method. This allows overrides to be added and removed without affecting the core metaContextVariables. So running prepareContext again does not cause issues as the core set of metaContextVariables won't have had any elements removed since any previous prepareContext runs.
Meta context variables denote those which have special meaning outside the context of the Jinjava template. In HubL, this includes variables like
content
.If these are manually overridden, such as inside a set tag or a for tag, then the lose their special functionality. This is mirrored by the set of
metaContextVariables
which can have keys removed inside of a set tag or for tag.If a meta context variable is removed and then an import tag is run, the meta context variable will re-appear due to the
prepareContext
method getting run again, which is used to re-add meta context variables.This PR adds a new method
getComputedMetaContextVariables()
and deprecates the oldgetMetaContextVariables()
method. This allows overrides to be added and removed without affecting the coremetaContextVariables
. So runningprepareContext
again does not cause issues as the core set ofmetaContextVariables
won't have had any elements removed since any previousprepareContext
runs.