Scopes are not broken in 2.2. If anything the problem is less complex now before than it was [grammar correction].
I just tested again, and it works fine.
In 2.2 not only are we using a new version of smarty, but we now do what we call 'mact pre-processing'.... so if any request is primarily for a module action (such as a News detail view) it is passed through smarty first, before the page template is even processed.
So...
My news detail template has:
my page template looks like (simplified)
Code: Select all
{process_pagedata}
<__html>
<head>
<title>{title}</title>
</head>
</__body>
<div class="sidebar">
{news limit=3}
</div>
<div class="main">
<h1>{title}</title>
{if !empty($testing)}<h2>Woot, global variable worked</h2>{/if}
{content}{* note, not usng any funky mechanism to assign content at the top. It will still work, but it is not necessary any more *}
</div>
<__body>
</__html>
And, yes... when I visit a news detail view that uses that detail template, I get the H1 with the page title, the H2 with the WOOT message, and then the News detail view. As I would expect.
In conclusion: Scoping has not changed, setting global variables works fine. It's even simpler than before. Perhaps it's something weird in your templates that you would have to narrow down and identify.
Addendum:
a: This MAY effect some sites that are trying to pass data IN to module action templates (such as News detail templates) to adjust behavior in those templates.
This is generally considered to be a bad idea. Instead, you should use multiple different templates, and/or template inheritance.
b: There is a config setting to disable this behavior. Read about it at:
https://docs.cmsmadesimple.org/configur ... -reference