-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBundle] Scope::has returns error: array_key_exists() expects parameter 2 to be array, null given #7342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The problem seems to be that $this->data in the Scope class can now be null, when before it was always an array? Now none of my templates work. |
The variable $this->data in src/Symfony/Bridge/Twig/NodeVisitor/Scope.php is not properly initialized as an array. If set()is not called before a call to has() or get(), the variable is null. This leads to the error. |
Could you send a PR with the fix ? |
Give me a minute. I'll try my first PR :) |
This PR was squashed before being merged into the 2.1 branch (closes #7344). Commits ------- c423f16 [2.1][TwigBridge] Fixes Issue #7342 in TwigBridge Discussion ---------- [2.1][TwigBridge] Fixes Issue #7342 in TwigBridge | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #7342 | License | MIT | Doc PR | -- --------------------------------------------------------------------------- by stof at 2013-03-12T13:28:15Z Can you add a test to avoid regressions ? --------------------------------------------------------------------------- by benbender at 2013-03-12T13:54:02Z Done --------------------------------------------------------------------------- by stevelacey at 2013-03-12T14:40:59Z Looks good to me? --------------------------------------------------------------------------- by pborreli at 2013-03-12T16:04:27Z 7517 :+1:
* 2.1: sub-requests are now created with the same class as their parent [FrameworkBundle] removed BC break [FrameworkBundle] changed temp kernel name in cache:clear [DoctrineBridge] Avoids blob values to be logged by doctrine [Security] use current request attributes to generate redirect url? [Validator] fix showing wrong max file size for upload errors [TwigBridge] removed double var initialization (refs #7344) [2.1][TwigBridge] Fixes Issue #7342 in TwigBridge [FrameworkBundle] fixed cahe:clear command's warmup [TwigBridge] now enter/leave scope on Twig_Node_Module [TwigBridge] fixed fixed scope & trans_default_domain node visitor [TwigBridge] fixed non probant tests & added new one [BrowserKit] added ability to ignored malformed set-cookie header [Translation] removed wriong 'use' [Translation] added xliff loader/dumper with resname support [TwigBridge] fixes Conflicts: src/Symfony/Bundle/FrameworkBundle/HttpKernel.php src/Symfony/Component/Security/Http/HttpUtils.php src/Symfony/Component/Translation/Loader/XliffFileLoader.php src/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php
Looks like there's now a problem when testing if a data is visible from current scope?
Twig_Error_Runtime: An exception has been thrown during the compilation of a template ("Warning: array_key_exists() expects parameter 2 to be array, null given in .../vendor/symfony/symfony/src/Symfony/Bridge/Twig/NodeVisitor/Scope.php line 94")
The text was updated successfully, but these errors were encountered: