0

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.

Micchaleq
  • 433
  • 1
  • 5
  • 21
  • why the error comes from cache?? use symfony console to clear cache. and install needed bundles (seems like errors on Translation bundle.) and use this page to start http://symfony.com/doc/master/cmf/index.html – JohnnyJS Nov 28 '14 at 19:54
  • That error shows when I try to clear cache. – Micchaleq Nov 28 '14 at 20:00
  • Try to clear the cache manually : from your project's root directory, run `rm -rf app/cache/* app/logs/*` – paulgv Nov 28 '14 at 20:17

3 Answers3

3

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.

Lashae
  • 1,372
  • 1
  • 20
  • 36
1

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

Brian
  • 555
  • 4
  • 18
0

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.*).

dbu
  • 1,497
  • 9
  • 8