Fosuserbundle: Overriding Controllers Sf3.4 - ignored calls

Created on 9 Apr 2018  路  5Comments  路  Source: FriendsOfSymfony/FOSUserBundle

When we try to override the Controllers as the documentation says to give our own functionallity, our code is ignored.

We want to redirect to backend when you open login page and you are logged in

We are using Sf3.4 + FOSUserBundle2

Most helpful comment

Thanks @bytehead as I can read in blog entrance you'd linked:

In Symfony 3.4 we worked towards simplifying bundles even more. That's why we deprecated bundle inheritance and we'll remove it in Symfony 4.0. This inheritance mechanism was traditionally used to override some templates, controllers and other elements of third-party bundles. In Symfony 4.0 you'll need to use alternative solutions to override those elements:

Controllers: define a route with the same path as the controller you want to override and implement your own logic.

We will try that.

Please, people of symfony, change the documentation of this bundle!

All 5 comments

Can you refer to the exact point in the documentation? (Provide a link)

Hi,
I have the same problem with the v2.1.2 & Sf3.3
It used to work with the version 2.0.2.
Our own controller overrided is ignored (ResettingController.php).

Thanks

I have this problem as well. Looks like a BC break to me. Bundle inheritance is just deprecated in 3.4: https://symfony.com/blog/new-in-symfony-3-4-deprecated-bundle-inheritance~~
See https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Upgrade.md#20-to-21

Thanks @bytehead as I can read in blog entrance you'd linked:

In Symfony 3.4 we worked towards simplifying bundles even more. That's why we deprecated bundle inheritance and we'll remove it in Symfony 4.0. This inheritance mechanism was traditionally used to override some templates, controllers and other elements of third-party bundles. In Symfony 4.0 you'll need to use alternative solutions to override those elements:

Controllers: define a route with the same path as the controller you want to override and implement your own logic.

We will try that.

Please, people of symfony, change the documentation of this bundle!

Was this page helpful?
0 / 5 - 0 ratings