Closed mysterty closed 8 years ago
Did you register the bundle in the kernel of your application?
I tried many different solutions, but none of them works...
But did you register the bundle in the kernel of your application?
This looks like a config problem and no general issue
@greg0ire : yes i registered it in kernel. I tried also without registering it. @core23 : It's maybe (and probably) a configuration problem, but it's exactly what i say : your doc is OUTDATED : https://sonata-project.org/bundles/media/2-2/doc/reference/installation.html What is the good configuration ? what is the correct installation process ?
yes i registered it in kernel
Prove it. This message says clearly otherwise :
The bundle 'SonataMediaBundle' does not exist or not defined in the kernel file!
@greg0ire : maybe cause the documentation clearly ask to don't download the bundle :
php composer.phar require sonata-project/media-bundle --no-update
The documentation says to not download it, because there is no point in downloading bundles one by one. You require them, and then you download all of them in one go.
Now I am under the impression that you have no idea what this means :
Did you register the bundle in the kernel of your application?
Otherwise you would have shown us your application kernel.
As i say, i follow YOUR documentation, so in my app kernel, there is :
<?php
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new Sonata\CoreBundle\SonataCoreBundle(),
new Sonata\MediaBundle\SonataMediaBundle(),
new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(),
// ...
);
}
Happy now ? Can we go on the true problem ? THE DOCUMENTATION IS WRONG AND OUTDATED.
So you're saying you did not download the bundle, but registered it in your kernel anyway? Wouldn't you get a class not found exception in that case ? Did you or did you not download the bundle?
Also, you're looking at version 2.2 of the documentation, and the branch 2.x is no longer supported. Please follow the master version, which is not wrong nor outdated.
When i strictly follow the documentation, i don't download the bundle. When i download the bundle, i have other errors. Actually, i have :
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
Unable to parse file "myproject/vendor/sonata-project/media-bundle/DependencyInjection/../Resources/config/gaufrette.xml".
Ok, i didn't see. I follow the link to the documentation given by git : https://github.com/sonata-project/SonataMediaBundle.
I will see the master one.
When i strictly follow the documentation, i don't download the bundle.
As you said, the documentation is wrong and outdated. Follow version master.
Actually, i have : [Symfony\Component\DependencyInjection\Exception\InvalidArgumentException] Unable to parse file "myproject/vendor/sonata-project/media-bundle/DependencyInjection/../Resources/config/gaufrette.xml".
Having this error is way better than having the other one. It means the media bundle configuration is loading, so you are closer to something that works. That's basic troubleshooting.
I follow the link to the documentation given by git
Thanks for pointing that out, we'll change it.
It's fixed, thanks again.
Thx you and the sonata team for all your work. ;)
Anyway i still have gaufrette issue, see that ticket : https://github.com/sonata-project/SonataMediaBundle/issues/987
It misses something in the doc now :
app kernel require Classification to be added
new Sonata\ClassificationBundle\SonataClassificationBundle(),
Need to replace call to app/console
by bin/console
Would you kindly make PRs for both of these issues?
done
But i found again problems when trying to install classification. I will make another ticket.
Hello, i'm trying to install the media bundle on my project, but i'm afraid that the documentation is outdated ("app/console" instead of "bin/console"). And so i encounter errors. I follow the doc and when i run
php bin/console sonata:easy-extends:generate --dest=src SonataMediaBundle
, i have that error :[Symfony\Component\Config\Exception\FileLoaderLoadException] There is no extension able to load the configuration for "sonata_media"
If i remove the config, then i have the error :
The bundle 'SonataMediaBundle' does not exist or not defined in the kernel file!