Closed Padam87 closed 8 years ago
Wow. Does anyone know why the admin bundle isn't required ? It is referenced in GalleryAdminController
, apparently. Using this controller is supposed to be optional, maybe ?
It is an optional dependency and should work without the SonataAdminBundle
, see: https://github.com/sonata-project/SonataMediaBundle/blob/master/DependencyInjection/SonataMediaExtension.php#L86
This xml files are referencing the Controller.
Indeed, I just saw that in the doc.
@Padam87 , can you use app/console -vvv cache:warmup
and give us a full stack trace ?
It is only an issue when warming the cache after a clear. Unfortunately the -vvv option wasn't really helpful.
Fatal error: Class 'Sonata\AdminBundle\Controller\CRUDController' not found in .....\vendor\sonata-project\media-bundle\Controller\GalleryAdminController.php on line 19
[Symfony\Component\Debug\Exception\ClassNotFoundException]
Attempted to load class "CRUDController" from namespace "Sonata\AdminBundle\Controller".
Did you forget a "use" statement for another namespace?
Exception trace: () at ....\vendor\sonata-project\media-bundle\Controller\GalleryAdminController.php:19
Maybe I'm wrong, but this seems like a class loader problem?
Well if you don't have the admin bundle, it will not load, so yeah…
How does warmup find this class ? Is there any route pointing to it? Or does it just look into every Controller
directory ?
@Padam87 : have you had a look at the routes (debug:router
? )
Yep, routing is not the problem. It is caused by the DiExtra bundle.
Can be fixed by adding the file to the blacklist.
jms_di_extra:
cache_warmer:
controller_file_blacklist:
- %kernel.root_dir%/../vendor/sonata-project/media-bundle/Controller/GalleryAdminController.php
Would you do us a big favor and document that ?
Yep, I will add it to the troubleshooting section.
php app\console cache:warmup
Fatal error: Class 'Sonata\AdminBundle\Controller\CRUDController' not found in .....\vendor\sonata-project\media-bundle\Controller\GalleryAdminController.php on line 19
To fix it I have to add the admin bundle to the dependencies, which is far from ideal. Any suggestions?