Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[TwigBundle] Fix usage of TwigBundle without FrameworkBundle#28893

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:3.4fromtgalopin:fix-twig-bundle-empty-add
Oct 21, 2018

Conversation

@tgalopin
Copy link
Contributor

QA
Branch?3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

According to the composer.json (https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/TwigBundle/composer.json), the FrameworkBundle shouldn't be required to use the bundle (which can be useful in tests of other bundles for instance). However, it is not the case, mainly due to issues with direct references to unavailable services.

I target 3.4 because812fbb4 is the main reason for the issue. We may have added additional problems in 4.0 and 4.1.

@tgalopintgalopin changed the titleFix twig bundle empty add[TwigBundle] Fix usage if TwigBundle without FrameworkBundleOct 16, 2018
@tgalopintgalopin changed the title[TwigBundle] Fix usage if TwigBundle without FrameworkBundle[TwigBundle] Fix usage of TwigBundle without FrameworkBundleOct 16, 2018
@stof
Copy link
Member

twig.runtime.httpkernel having a reference to the fragment handler service is not an issue. We should only move thetwig.runtime tag to the compiler pass, as done for the extension itself. If the service does not exist, the compiler pass would not tag it as a twig runtime, and so nothing references it (and the service gets removed, and so the non-existing reference is not an issue). So I would keep the argument in the XML file, which makes it more readable when looking at the service definition.


<serviceid="twig.controller.preview_error"class="Symfony\Bundle\TwigBundle\Controller\PreviewErrorController"public="true">
<argumenttype="service"id="http_kernel"/>
<argument />
Copy link
Member

Choose a reason for hiding this comment

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

that is still a broken service definition here. The compiler pass should not handle adding the argument, but should handle removing the service instead (if we don't have HttpKernel, we don't really need the error preview controller)

yceruto reacted with thumbs up emoji
@nicolas-grekasnicolas-grekas added this to the3.4 milestoneOct 17, 2018
@tgalopintgalopinforce-pushed thefix-twig-bundle-empty-add branch from9a85049 tocad2d39CompareOctober 18, 2018 09:18
@tgalopin
Copy link
ContributorAuthor

Updated

Copy link
Member

@fabpotfabpot left a comment

Choose a reason for hiding this comment

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

To be merged in master (no 3.4 versions worked without FrameworkBundle).

@fabpotfabpotforce-pushed thefix-twig-bundle-empty-add branch fromcad2d39 to246a905CompareOctober 21, 2018 06:50
@fabpot
Copy link
Member

Thank you@tgalopin.

@fabpotfabpot merged commit246a905 intosymfony:3.4Oct 21, 2018
fabpot added a commit that referenced this pull requestOct 21, 2018
…Bundle (tgalopin)This PR was squashed before being merged into the 3.4 branch (closes#28893).Discussion----------[TwigBundle] Fix usage of TwigBundle without FrameworkBundle| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -According to the composer.json (https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/TwigBundle/composer.json), the FrameworkBundle shouldn't be required to use the bundle (which can be useful in tests of other bundles for instance). However, it is not the case, mainly due to issues with direct references to unavailable services.I target 3.4 because812fbb4 is the main reason for the issue. We may have added additional problems in 4.0 and 4.1.Commits-------246a905 [TwigBundle] Fix usage of TwigBundle without FrameworkBundle
@fabpot
Copy link
Member

And you got it in 3.4 as I forgot to switch the branch when merging :)

tgalopin reacted with laugh emoji

This was referencedNov 3, 2018
@tgalopintgalopin deleted the fix-twig-bundle-empty-add branchNovember 3, 2018 12:43
@fabpotfabpot mentioned this pull requestNov 3, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

5 participants

@tgalopin@stof@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp