Fosuserbundle: Overriding templates in a child bundle is broken after ed6a1a9

Created on 27 Dec 2016  路  14Comments  路  Source: FriendsOfSymfony/FOSUserBundle

After commit ed6a1a931b438da361eb76f5145a9c25616cb0ca I can't use my templates.
AppKernel.php

    public function registerBundles()
    {
        $bundles = [
            ...
            new FOS\UserBundle\FOSUserBundle(),
            new Wapinet\UserBundle\WapinetUserBundle(),
        ];
        return $bundles;
    }

Wapinet\UserBundle\WapinetUserBundle.php

<?php

namespace Wapinet\UserBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class WapinetUserBundle extends Bundle
{
    public function getParent()
    {
        return 'FOSUserBundle';
    }
}

and i override some controllers and templates.
after this update symfony use FOS\UserBundle\FOSUserBundle, not my overrided code (Wapinet\UserBundle\WapinetUserBundle).

Most helpful comment

The template override issue is because of a bug in Symfony (discovered when we did this change). Fixing it is in progress on the Symfony side and should be available in the next patch releases. In the meantime, you can keep using the beta1 release (as the change was done after the release).

I will keep this ticket open until the issue is solved on the Symfony side.

All 14 comments

Did you try overwriting them with the new syntax. Not the old one?

Yes, this is also an option. but then I'd have to rewrite everything!
Every method that calls render. Every template that uses a different template FOSUserBundle.

Two points.:

  • 2.0 is not yet stable so BC are allowed.
  • it's not that many templates

Duplication of issue #2376 .

@Gemorroj Can you please check if symfony/symfony#21077 would solve your issue?

The template override issue is because of a bug in Symfony (discovered when we did this change). Fixing it is in progress on the Symfony side and should be available in the next patch releases. In the meantime, you can keep using the beta1 release (as the change was done after the release).

I will keep this ticket open until the issue is solved on the Symfony side.

For reference, the Symfony PR is at https://github.com/symfony/symfony/pull/19586

This has been fixed: https://github.com/symfony/symfony/commit/0c77ce2355dad4d5011421b88755f2c6e430ef0f
I don't know when new release with this fix will be released

Well, @stof you can close, fix have been pushed :)

Hrm, I am still seeing issues using the LiipThemeBundle the overriden template is still not the right one. It works on dev-master#c0ba632.

After updating Symfony 3.2.2 works well.

Actually after some research I think my issue is related to the LiipThemeBundle.

The related Symfony PR has been merged and released, I was able to fix this upgrading to the latest patch version.

:+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hermandinho picture hermandinho  路  4Comments

mirbahar picture mirbahar  路  6Comments

kironet picture kironet  路  4Comments

pmpr-ir picture pmpr-ir  路  3Comments

tinntsea picture tinntsea  路  5Comments