8000 BUG: KNP Menu: Unable to find template "knp_menu.html.twig" · Issue #21281 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

BUG: KNP Menu: Unable to find template "knp_menu.html.twig" #21281

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
Aerendir opened this issue Jan 13, 2017 · 7 comments
Closed

BUG: KNP Menu: Unable to find template "knp_menu.html.twig" #21281

Aerendir opened this issue Jan 13, 2017 · 7 comments

Comments

@Aerendir
Copy link
Contributor
Aerendir commented Jan 13, 2017
Q A
Bug report? yes
Feature request? no
BC Break report? yes
RFC? yes/no
Symfony version 2.8.16

The error appeared after upgrading composer that upgraded Symfony to version 2.8.16.
Falling back to Symfony 2.8.15 "solves" the error.

What have I to do?

I opened this same issue on the KNP Menu repository, too.

@Aerendir Aerendir changed the title KNP Menu: Unable to find template "knp_menu.html.twig" BUG: KNP Menu: Unable to find template "knp_menu.html.twig" Jan 13, 2017
@xabbuh
Copy link
Member
xabbuh commented Jan 13, 2017

Can you fork the Symfony Standard Edition and make the changes that are necessary to reproduce your issue?

@umulmrum
Copy link
Contributor

I can confirm the problem for Symfony 3.2.2 - "solved" after downgrading symfony/symfony to 3.2.1

@xabbuh
Copy link
Member
xabbuh commented Jan 13, 2017

@umulmrum Can you describe which steps we need to do to reproduce your issue?

@umulmrum
Copy link
Contributor

@xabbuh I haven't managed yet to reproduce the issue with a fork of the standard edition.
What's a bit strange is the error message:

"Unable to find template "knp_menu.html.twig" (looked into: [my document root]/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in AppBundle::menu.html.twig at line 1."

Looks like only the form directory is considered, but I have no clue why. Possibly this problem is related to #19586

@umulmrum
Copy link
Contributor
umulmrum commented Jan 13, 2017

@xabbuh OK, it was actually quite easy to reproduce.

Just follow the instructions in the KnpMenuBundle docs to add a menu in the most simple way, and additionally set another menu template in config.yml. But what is important: The error only occurs if the KnpMenuBundle is registered AFTER the TwigBundle in AppKernel. I tend to sort things alphabetically instead of appending at the end, but didn't do this first when trying to reproduce.

I pushed the failing app state to https://github.com/umulmrum/symfony-standard/tree/3.2

@xabbuh
Copy link
Member
xabbuh commented Jan 14, 2017

@umulmrum Thank you for your great effort to provide the failing example. It helped me a lot to reproduce your issue and work on a fix.

@Aerendir @umulmrum Could you both please check if #21285 fixes your issue?

nicolas-grekas added a commit that referenced this issue Jan 14, 2017
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBundle] do not lose already set method calls

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21281
| License       | MIT
| Doc PR        |

Commits
-------

cb1a4b7 [TwigBundle] do not lose already set method calls
7D5A
@umulmrum
Copy link
Contributor

@xabbuh I merged 2.7 into 3.2 locally and the problem is gone. Thanks for the really quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
0