8000 Extends view not found · Issue #2376 · FriendsOfSymfony/FOSUserBundle · GitHub
[go: up one dir, main page]

Skip to content

Extends view not found #2376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Thibault34 opened this issue Dec 26, 2016 · 30 comments
Closed

Extends view not found #2376

Thibault34 opened this issue Dec 26, 2016 · 30 comments

Comments

@Thibault34
Copy link

Hello,

Since the implementation of the latest version two days ago, the heritagle of the views (to use those of my bundle and not those of FOSUserBundle) no longer works. Can someone explain me why please?

@LaurentMarquet
Copy link
LaurentMarquet commented Dec 26, 2016

They have been renamed. Have a look at Resources > views to have the new name. Mainly the "_" replace the "-". So you just have to rename your templates according to the new names.

@Thibault34
Copy link
Author

Thank you

@Thibault34
Copy link
Author
Thibault34 commented Dec 27, 2016

Hello,
I have look, but, I don't undertrand, my view name is "login.html.twig"

@axzx
Copy link
axzx commented Dec 27, 2016

this commit ed6a1a9 makes problem

@Thibault34
Copy link
Author

There is no way to use the views of my bundle that inherits from FOSUserBundle so?

@axzx
Copy link
axzx commented Dec 27, 2016

I also would like to know:)
@stof

@stof
Copy link
Member
stof commented Dec 27, 2016

hmm, so the bundle inheritance does not allow to overwrite templates using the native Twig notation ? This looks like a bug in Symfony then.
However, I suggest you to use the app/Resources/FOSUserBundle/views folder to overwrite the FOSUserBundle templates anyway, as this is what the Symfony documentation is recommending since months (and maybe even years).

Regarding the bundle inheritance issue, I suggest you to open an issue on the symfony repo.

@axzx
Copy link
axzx commented Dec 27, 2016

@stof
If I use the app/Resources/FOSUserBundle/views folder, then I can't extend like this:

{% extends "@CustomUser/base.html.twig" %}

I've got an error:
resource is hidden by a resource from the "CustomUserBundle" derived bundle

@stof
Copy link
Member
stof commented Dec 27, 2016

Can you give the full error message ? This is only part of it.

8000
@Thibault34
Copy link
Author

@axzx
Although I would like to keep all the views in my bundle, for me, the given solution works.
I think you put all the views in app/resources/views. You also have to move base.html.twig. It should be left in /src/CustomUserBundle/views this one.

@axzx
Copy link
axzx commented Dec 27, 2016

@stof

[RuntimeException]
"app/Resources/FOSUserBundle/views/Security/login.html.twig" resource is hidden by a resource from the "CustomUserBundle" derived bundle. Create a "app/Resources/Custom
UserBundle/views/Security/login.html.twig" file to override the bundle resource.

It occurs only in command line cach:clear

@LaurentMarquet
Copy link

Using Symfony 3.2.1 and latest FOSUserBundle commit, having templates in app/Resources/FOSUserBundle/views I can use both {% extends "FOSUserBundle::layout.html.twig" %} and {% extends "@FOSUser/layout.html.twig" %}. This takes my templates.

@stof
Copy link
Member
stof commented Dec 27, 2016

Well, if you access it as @CustomUSer/base.html.twig, it should indeed stay in CustomUserBundle (or in app/Resources/CustomUserBundle/views. If you want to put it in app/Resources/FOSUserBundle/views, you indeed need to reference it as FOSUserBundle.

xabbuh referenced this issue Dec 27, 2016
Use native Twig references for templates
@Strategy47
Copy link

Hi,
I have difficulties to understand. This problem comes from symfony?
If you are in prod and need to fix quickly

cd vendor/friendsofsymfony/user-bundle && git checkout 612649c

@maxime-pasquier
Copy link

Or downgrade to "friendsofsymfony/user-bundle": "2.0.x-dev#612649c", into your composer.json file.

@lucagtc
Copy link
lucagtc commented Dec 27, 2016

See Symfony documentation - Overriding Resources: Templates, Routing, etc
Try use long version @FOSUserBundle/Resources/views/.... instead of short @BundleName/... in the FOSUserBundle action render.

@gondo
Copy link
gondo commented Dec 27, 2016

another ridiculous update.
i had enough. until i completely remove this broken bundle, i ended up fixing specific commit in composer:
"friendsofsymfony/user-bundle": "dev-master#c0ba63245f4155b3bc7060298089c2bf806cc002",

@Strategy47
Copy link

@gondo
I do not agree with you.
If bundle developers do not meet symfony best practices it will become unreasonable.
FOSUser is still a great job that no more restructuring time would be wasted for sf developers.

@Kmelia Thank you I just discovered this practice

@mvrhov
Copy link
mvrhov commented Dec 27, 2016

Why so many pissed of developers. Using development branch you should expect a lot of breakage especially when this in the process of refactoring.
I started with symfony way before it was stable. and in one of our product I had to rewrite forms at least 4 times. Am I pissed of no.

@maxime-pasquier
Copy link

@Discutea you're welcome ;)

@mvrhov totally agree! We use development branch to get latest updates, but we know that is dev ;)
Do composer install only (with the composer.lock file) on production platforms ;)

@xabbuh
Copy link
Member
xabbuh commented Dec 28, 2016

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

@maxime-pasquier
Copy link

@xabbuh yes, it's works for me!

@Thibault34
Copy link
Author

@Kmelia it's fix in Symfony 3.2.1 ?

@stof
Copy link
Member
stof commented Jan 2, 2017

@Thibault34 symfony/symfony#19586 is not merged yet

@Thibault34
Copy link
Author

Ha ok, thank

@maxime-pasquier
Copy link

@Thibault34 nope, I just try the fix on my project ;)

@chalasr
Copy link
chalasr commented Jan 4, 2017

@Kmelia Could you try out symfony/symfony#19586 instead and let us know if it works for you?

@maxime-pasquier
Copy link

@chalasr I will try tomorrow morning.

@maxime-pasquier
Copy link

@chalasr the PR does not work on a 3.x branch, so I could not test!

@stof
Copy link
Member
stof commented Jan 11, 2017

Closing in favor of #2378 (no need to keep 2 opened issues tracking this)

@stof stof closed this as completed Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0