-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Bug in getTemplating_Helper_AssetsService() Symfony 2.7-Beta 1 #14368
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
Can you paste the generated |
sorry I forgot. Here it is!
The first parameter for AssetHelper is an empty string, where as we look at the constructor of AssetHelper, it actually expects an Asset\Packages object.
|
I got the same error here.
Generated code in the devcontainer: /**
* Gets the 'templating.helper.assets' service.
*
* This service is shared.
* This method always returns the same instance of the service.
*
* @return \Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper A Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper instance.
*/
protected function getTemplating_Helper_AssetsService()
{
return $this->services['templating.helper.assets'] = new \Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper('', array());
} |
The faulty service is configured here: <parameter key="templating.helper.assets.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper</parameter>
<!--
This service will be moved to templating_php.xml in version 3.0, it exists here for BC reasons.
-->
<service id="templating.helper.assets" class="%templating.helper.assets.class%">
<tag name="templating.helper" alias="assets" />
<argument /> <!-- default package -->
<argument type="collection" /> <!-- named packages -->
</service> but the class: has only the new construcor with the only parameter " Package $package" public function __construct(Packages $packages)
{
$this->packages = $packages;
} |
@taemtha I don't find any code that replace the first argument with a default package, if you delete the |
The first argument is replaced by FrameworkExtension. |
@jakzal that code replaces the default package and the packages into the
must be
correct me if i'm wrong |
The tests of AssetsHelper seems fine, but the definition seems wrong. |
Same bug error with IvoryCKEditorBundle library |
@markitosgv Can you please also check if #14419 goddess this for you? |
@xabbuh test ok! solve IvoryCKEditorBundle problem too |
This PR was merged into the 2.7 branch. Discussion ---------- inject asset packages in assets helper service | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #14368 | License | MIT | Doc PR | Commits ------- 6928507 inject asset packages in assets helper service
Yes this fixed it! |
This was triggered by having {{ tinymce_init() }} in a javascript block.
An exception has been thrown during the rendering of a template ("Catchable Fatal Error: Argument 1 passed to Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper::__construct() must be an instance of Symfony\Component\Asset\Packages, string given, called in /my/directory/app/cache/dev/appDevDebugProjectContainer.php on line 5370 and defined"
The text was updated successfully, but these errors were encountered: