Skip to content
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

Removed unwanted leftover 'use' throwing fatal. #16

Closed
wants to merge 1 commit into from

Conversation

rat4m3n
Copy link

@rat4m3n rat4m3n commented Nov 3, 2012

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
Copy link
Member

lsmith77 commented Nov 4, 2012

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

@rat4m3n
Copy link
Author

rat4m3n commented Nov 4, 2012

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
Copy link
Member

dbu commented Nov 4, 2012

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
Copy link
Author

rat4m3n commented Nov 4, 2012

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.

@rat4m3n rat4m3n closed this Nov 4, 2012
@dbu
Copy link
Member

dbu commented Nov 4, 2012

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
Copy link
Author

rat4m3n commented Nov 4, 2012

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
Copy link
Member

dbu commented Nov 5, 2012

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

i created schmittjoh/JMSDiExtraBundle#63 to get some input

@lsmith77
Copy link
Member

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

@lsmith77 lsmith77 reopened this Nov 24, 2012
@lsmith77 lsmith77 closed this Nov 24, 2012
@dbu
Copy link
Member

dbu commented Nov 27, 2012

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
Copy link
Member

no i have not.

@dbu
Copy link
Member

dbu commented Nov 28, 2012

ok, created #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants