merged branch deadbeef84/getglobals-before-addglobal-bug (PR #990)
authorFabien Potencier <fabien.potencier@gmail.com>
Fri, 8 Feb 2013 16:36:01 +0000 (17:36 +0100)
committerFabien Potencier <fabien.potencier@gmail.com>
Fri, 8 Feb 2013 16:36:01 +0000 (17:36 +0100)
This PR was merged into the master branch.

Commits
-------

667b274 Added unit test for bug when calling getGlobals() before addGlobal() on Twig_Environment.

Discussion
----------

Bug when calling getGlobals() before addGlobal() on Twig_Environment.

There seems to be an issue when calling getGlobals() before addGlobal(), the globals wont get updated. It doesn't seem to matter if the global existed before the call to getGlobals(). An update of the globals can be forced by calling an additional getGlobals() after the addGlobal() call.

I believe the problem has something to do with runtimeInitialized/extensionInitialized being set to true during rendering, but globals don't get updated during that phase.

Not sure how to fix it so I'm just sending you a unit test showcasing the bug.


Trivial merge