Symfony 2 CMF - Installing cmf sandbox

521 views Asked by At

I try to install smf-sandbox from git https://github.com/symfony-cmf/cmf-sandbox

But I got error:

Catchable Fatal Error: Argument 2 passed to Symfony\Cmf\Bundle\RoutingBundle\Admin\Extension\FrontendLinkExtension::__construct() must be an instance of Symfony\Bundle\FrameworkBundle\Translation\Translator, instance of Symfony\Component\Translation\LoggingTranslator given, called in \cmf\app\cache\dev\appDevDebugProjectContainer.php on line 5251 and defined

I start useing SF CMF so I don't know where I have to search. Someone can help me?

I tried to find some solution on Internet but I can't find anything.

EDIT: That error shows when I try to clear cache.

3

There are 3 answers

0
Brian On

You can either downgrade symfony/symfony to 2.5.* or upgrade symfony-cmf/routing-bundle to dev-master:

in composer.json "require": { // to downgrade symfony: "symfony/symfony": "2.5.*", // OR "symfony-cmf/routing-bundle": "dev-master@dev", // upgrade CmfRoutingBundle } Followed by: $ composer update symfony-cmf/routing-bundle

0
Lashae On

In deed translator service before Symfony 2.6 was an alias for translator.default, unfortunately this has changed in Symfony 2.6 with the addition of LoggingTranslator feature. (You can verify this by running php app/console container:debug)

If the code is not typehinted correctly, than you need to use the translator.default service explicitly, the translator service may cause errors.

See this Github issue for complete internals.

0
dbu On

The problem was that this new extension was expecting a concrete class instead of an interface, which became a problem in Symfony 2.6. This was fixed last week and i just released version 1.3.3 of the RoutingBundle now. You can simply composer update symfony-cmf/routing-bundle without needing to change your version constraint (assuming you require 1.3.*).