Closed fatguytyson closed 9 years ago
Hi,
it is always strange when dev enviroment works and prod doesn't work.
Here is first suggestions for you
Try to run this command and let's see is still the same error or not:
app/console doctrine:schema:update app/console ca:cl --env=prod
If there is still problem send me sonata media bundle version and your symfony project version?
Hello, Thank you for the reply. I missed the media bundle request when I replied via email.
Media-bundle: 2.3.3 Symfony (tried on each): 2.6., 2.7., 2.8.*
Hi fatguytyson,
Did you try to manually remove cache from disc (rm -rf app/cache/*)? After that you can execute app/console doc:sc:up --force That saved me a few times.
hangs head solemnly, Now that I have slept and working down doctrines building steps, I realized my mistake. I assumed the Sonata Easy Extends Bundle was a builder only, and placed it in the dev/test bundles to save memory and execution time. Apparently, it helps doctrine link the entities it helped create. I moved the bundle to production and everything is running fine. Thank you so much for the prompt response. I also appreciate seeing the structure of this bundle so I can continue to improve my own Symfony coding.
Thank you again.
I have inserted the bundle into my project and in the dev environment, everything is working great. The prod environment though has a 500 error on the admin-media-list page. Here is the error: [2015-12-01 04:52:27] request.CRITICAL: Uncaught PHP Exception Doctrine\ORM\Query\QueryException: "[Semantical Error] line 0, col 90 near 'hasMedias INNER': Error: Class Application\Sonata\MediaBundle\Entity\Media has no association named galleryHasMedias" at /home/xxx/public_html/dev/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php line 63 {"exception":"[object](Doctrine\ORM\Query\QueryException%28code: 0%29: [Semantical Error] line 0, col 90 near 'hasMedias INNER': Error: Class Application\Sonata\MediaBundle\Entity\Media has no association named galleryHasMedias at /home/xxx/public_html/dev/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php:63, Doctrine\ORM\Query\QueryException%28code: 0): SELECT m FROM Application\Sonata\MediaBundle\Entity\Media m INNER JOIN m.galleryHasMedias hasMedias INNER JOIN hasMedias.gallery g WHERE g.name= :mediaGallery AND hasMedias.enabled = 1 AND m.enabled = 1 ORDER BY m.id DESC at /home/xxx/public_html/dev/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php:41)"} []
Any help would be greatly appreciated.