symfony-cmf / simple-cms-bundle

UNMAINTAINED - A more-than-simple cms based on the cmf components
http://cmf.symfony.com/
49 stars 45 forks source link

Removed unwanted leftover 'use' throwing fatal. #16

Closed rat4m3n closed 11 years ago

rat4m3n commented 12 years ago

This was cousing fatal from time to time.

PHP Fatal error: Class 'Sonata\AdminBundle\Controller\CRUDController' not found in [..] /vendor/symfony-cmf/simple-cms-bundle/Symfony/Cmf/Bundle/SimpleCmsBundle/Controller/PageAdminController.php on line 8

lsmith77 commented 12 years ago

was this a recent BC break in the admin bundle? are you using the master version?

rat4m3n commented 12 years ago

Well not sure if this is 100% accurate fix, but I dont have Sonata bundle and this thrown an error randomly both in console and front end while doing totally various tasks. I have been using recent CMF standard.

I discovered we are missing Security Bundle and Generate bundle and SwiftMailer and some other too like ORM in CMF Standard, causing some issues. Other then that all seems to be working brilliant.

dbu commented 12 years ago

the fix is not ok like this, it would just break the admin controller.

either you have set use_sonata_admin to true in your config and thus try to load things you don't want to. or there could be something that looks for controller classes and tries to load them to cache something or read some annotations or i don't know what. if that is the case we have a problem, as the idea would be that you can use the bundle without sonata admin.

@rat4m3n can you make a gist with a stack trace, and tell us what commands trigger the problem? cache:clear?

rat4m3n commented 12 years ago

cache cleared, assets dumbed, sonata admin set to false in config.

error has been triggered on cache:clear and front end home page but no consistency.

dbu commented 12 years ago

weird. if you can find a way to reproduce, please tell. if something (maybe the annotations thing that does routing by annotation??) kicks us here, we should do something. maybe we can move the admin controllers to Admin to make it not find it - but we would need to be able to reproduce the problem reliably to be sure we solved it...

rat4m3n commented 12 years ago

I have set up a repo with my setup.

https://github.com/rat4m3n/cmf-standard-fosuser

This is just cmf standard (+ some missing bundles from standard) + fosuser.

Stack is:

PHP Fatal error: Class 'Sonata\AdminBundle\Controller\CRUDController' not found in /Users/pawel/Sites/SYMFONY/cmf-standard-fosuser.local/vendor/symfony-cmf/simple-cms-bundle/Symfony/Cmf/Bundle/SimpleCmsBundle/Controller/PageAdminController.php on line 8 PHP Stack trace: PHP 1. {main}() /Users/pawel/Sites/SYMFONY/cmf-standard-fosuser.local/app/console:0 PHP 2. Symfony\Component\Console\Application->run() /Users/pawel/Sites/SYMFONY/cmf-standard-fosuser.local/app/console:22 PHP 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /Users/pawel/Sites/SYMFONY/cmf-standard-fosuser.local/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:105 PHP 4. Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands() /Users/pawel/Sites/SYMFONY/cmf-standard-fosuser.local/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:68 PHP 5. Symfony\Component\HttpKernel\Kernel->boot() /Users/pawel/Sites/SYMFONY/cmf-standard-fosuser.local/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:83 PHP 6. Symfony\Component\HttpKernel\Kernel->initializeContainer() /Users/pawel/Sites/SYMFONY/cmf-standard-fosuser.local/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:133 PHP 7. Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate->warmUp() /Users/pawel/Sites/SYMFONY/cmf-standard-fosuser.local/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:595 PHP 8. JMS\DiExtraBundle\HttpKernel\ControllerInjectorsWarmer->warmUp() /Users/pawel/Sites/SYMFONY/cmf-standard-fosuser.local/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php:47 PHP 9. JMS\DiExtraBundle\HttpKernel\ControllerInjectorsWarmer->findControllerClasses() /Users/pawel/Sites/SYMFONY/cmf-standard-fosuser.local/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/HttpKernel/ControllerInjectorsWarmer.php:29 PHP 10. require_once() /Users/pawel/Sites/SYMFONY/cmf-standard-fosuser.local/vendor/jms/di-extra-bundle/JMS/DiExtraBundle/HttpKernel/ControllerInjectorsWarmer.php:52

Fatal error: Class 'Sonata\AdminBundle\Controller\CRUDController' not found in /Users/pawel/Sites/SYMFONY/cmf-standard-fosuser.local/vendor/symfony-cmf/simple-cms-bundle/Symfony/Cmf/Bundle/SimpleCmsBundle/Controller/PageAdminController.php on line 8

[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.

dbu commented 12 years ago

hm, ok that is what i feared. i created vendor/jms/di-extra-bundle/JMS/DiExtraBundle/HttpKernel/ControllerInjectorsWarmer.php

i created https://github.com/schmittjoh/JMSDiExtraBundle/issues/63 to get some input

lsmith77 commented 11 years ago

we can now implement a solution as shown in https://github.com/schmittjoh/JMSDiExtraBundle/issues/74 to automate the blacklisting of the relevant controller classes. however users can now also do it themselves.

dbu commented 11 years ago

cool. did you already implement the feature in the cmf bundles now lukas? if not we should create an issue about it. needs to be fixed in all cmf bundles that have admin controllers.

lsmith77 commented 11 years ago

no i have not.

dbu commented 11 years ago

ok, created #21