Hi,
I have this error :
There is no extension able to load the configuration for "fos_user" (in .../Symfony/app/config/config.yml).
fos_user:
db_driver: orm
firewall_name: main
class:
model:
user: Sdv\MonitoringBundle\Entity\User
Please, could you help me ?
You need to register the bundle in your kernel.
I've done so, my AppKernel.php looks like this :
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
new FOS\UserBundle\FOSUserBundle(),
new Acme\DemoBundle\AcmeDemoBundle(),
new Sdv\MonitoringBundle\SdvMonitoringBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Symfony\Bundle\WebConfiguratorBundle\SymfonyWebConfiguratorBundle();
}
return $bundles;
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
}
}
Which version of Symfony are you using ?
Symfony2 Beta1
Which commit of the bundle are you using ?
The PR6 tag
If I update to the latest version, I get this exception :
Symfony\Component\DependencyInjection\Exception\NonExistentServiceException' with message 'The service "security.firewall.map.context.secured_area" has a dependency on a non-existent service "security.user.provider.concrete.user_provider".'
Well, as stated by the readme and in its name, the PR6 tag was the version working with Sf2 PR6.
you need to clear your cache when upgrading.
and the latest version of the bundle is for the current Sf2 master branch. You will need to reset your bundle version before the changes done for beta2.
I cleared my cache, it doesn't change a thing.
Could you not make a tag for Beta1 and next for Beta2 ? So I'll be able to download the corresponding version of the bundle.
I don't think we want to add a tag for beta1 now as beta2 will be there soon and the forms are broken in beta1. We fixed them only after the changes for the mapping BC break between beta1 and beta2 so there is no way to provide a working version easily.
Even in the latest master version of Symfony2, I get the same error !
It definetly works for me using the latest master of Symfony2 and of the bundle.
Ok, but could you help me find a solution to my problem ?
The exception you get about the firewall service seems to be an issue in your Security config. Check the doc to have a working version of it.
I have completely replaced the security config file by the exemple in the doc. It seems to have fixed this error.
Now I have this one :
Fatal error: Sdv\MonitoringBundle\Entity\User cannot implement FOS\UserBundle\Entity\User - it is not an interface
The beginning of my User Entity looks like :
namespace Sdv\MonitoringBundle\Entity;
use FOS\UserBundle\Entity\User as BaseUser;
/**
it is extends, not implements.
OK, now it works.
I juste had to create manualy the database fields.
And now I have this error in /user/new : No mapping found for field 'username' on class 'Sdv\MonitoringBundle\Entity\User'.
And in /login, I get : Unrecognized field: usernameCanonical
It seems too complex for me, this bundle. It doesn't seem to work seamlessly.
@arnobeck You need to use the latest version of the framework when using the latest version of the bundle as there is a BC break between beta1 and master about the mapping location. The bundle is in sync with the master branch as stated in the readme.
I'm using both latest versions.
Are you sure that you are using the version from the symfony/symfony repo ? I just tried and it finds the mapping for the class.
Another issue could be that you don't register the FOSUserBundle in your ORM config. You need to use the automapping option or to register it explicitly.
With the latest version, I get this error :
Fatal error: Call to undefined method Symfony\Component\HttpFoundation\Request::hasPreviousSession() in vendor/symfony/src/Symfony/Bundle/FrameworkBundle/RequestListener.php on line 70
You need to update the bootstrap file when you update Symfony by running the bin/build_bootstrap.php script.
Now I get this error :
Unable to load class "Monolog\Handler\AbstractProcessingHandler"
I suppose I need to update the vendors too ?
yeah
Most helpful comment
You need to register the bundle in your kernel.