Skip to content
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

[FrameworkBundle] Fix template location for PHP templates #15272

Merged
merged 2 commits into from Jan 25, 2016

Conversation

jakzal
Copy link
Contributor

@jakzal jakzal commented Jul 14, 2015

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #14804
License MIT
Doc PR -
  • improve the test to cover logical path & filesystem path
  • Add a new test case and fix the path to the template

As the first commit only enchanced the test, and the second commit fixed the bug, it's best to review them seperately.

@jakzal jakzal force-pushed the bugfix/php-template-location branch from d024fde to cd42e2d Compare July 14, 2015 14:54
@weaverryan
Copy link
Member

@jakzal I see you've enhanced the test - but I'm confused (in part, because I honestly haven't spent much time looking into the template name parsing stuff): this doesn't contain a fix for #14804 or add a failing test case. Was this just a step 1 to enhance to test? Or am I missing something (or perhaps I haven't answered your questions well yet on #14804).

Thanks for taking this on - I see PR's from you fixing issues. It's awesome.

@jakzal
Copy link
Contributor Author

jakzal commented Jul 15, 2015

@weaverryan indeed. That's why it's marked WIP. I updated PR's description.

Few test cases are either wrong ("name.twig" and "name"), or we should treat them differently then templates that follow the "name.html.twig" pattern.

@jakzal jakzal changed the title [WIP][FrameworkBundle] Fix template location for PHP templates [FrameworkBundle] Fix template location for PHP templates Jul 15, 2015
@jakzal
Copy link
Contributor Author

jakzal commented Jul 15, 2015

Are "name.twig" and "name" even valid template names? I went with the second option for now to avoid changing existing cases.

@weaverryan
Copy link
Member

@jakzal I don't know if name or name.twig should be valid (name.twig should in my opinion). Best to keep these as they are for BC.

array('/path/to/section/name.php', '/path/to/section/name.php', '/path/to/section/name.php', new BaseTemplateReference('/path/to/section/name.php', 'php')),
array('name.twig', 'name.twig', 'name.twig', new BaseTemplateReference('name.twig', 'twig')),
array('name', 'name', 'name', new BaseTemplateReference('name')),
array('default/index.html.php', '::default/index.html.php', 'views/default/index.html.php', new TemplateReference(null, null, 'default/index', 'html', 'php')),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this last entry is the only one that was really added or changed at all, right?

What I don't understand yet is why default/index.html.twig seems to have always pointed to ::default/index.html.twig but default/index.html.php did not work correctly (and it only starts working "incorrectly" once both the twig and php engines are enabled).

@jakzal
Copy link
Contributor Author

jakzal commented Oct 23, 2015

status: needs review

@jakzal
Copy link
Contributor Author

jakzal commented Oct 29, 2015

ping @symfony/deciders

@jakzal jakzal added the Ready label Oct 29, 2015
@xabbuh
Copy link
Member

xabbuh commented Oct 30, 2015

I have some hard time wrapping my head around these changes, but the result looks like what we expect.

@fabpot
Copy link
Member

fabpot commented Jan 25, 2016

Thank you @jakzal.

@fabpot fabpot merged commit 132a4e4 into symfony:2.3 Jan 25, 2016
fabpot added a commit that referenced this pull request Jan 25, 2016
…(jakzal)

This PR was merged into the 2.3 branch.

Discussion
----------

[FrameworkBundle] Fix template location for PHP templates

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

- [x] improve the test to cover logical path & filesystem path
- [x] Add a new test case and fix the path to the template

As the first commit only enchanced the test, and the second commit fixed the bug, it's best to review them seperately.

Commits
-------

132a4e4 [FrameworkBundle] Fix template location for PHP templates
cd42e2d [FrameworkBundle] Add path verification to the template parsing test cases
@jakzal jakzal deleted the bugfix/php-template-location branch January 26, 2016 17:10
@fabpot fabpot mentioned this pull request Feb 3, 2016
This was referenced Feb 28, 2016
fabpot added a commit that referenced this pull request Mar 3, 2016
…mplate paths (jakzal)

This PR was merged into the 2.3 branch.

Discussion
----------

[FrameworkBundle] Fix a regression in handling absolute template paths

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

Regression introduced by #15272.

Commits
-------

d8c493f [FrameworkBundle] Fix a regression in handling absolute and namespaced template paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants