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] Added the assets helper again #17041

Merged
merged 1 commit into from Jan 19, 2016
Merged

[FrameworkBundle] Added the assets helper again #17041

merged 1 commit into from Jan 19, 2016

Conversation

dosten
Copy link
Contributor

@dosten dosten commented Dec 17, 2015

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
License MIT

This PR is a follow up of #14972, we deprecated and removed the AssetsHelper in 2.7/3.0 doing impossible to use the Asset component and the PHP templates together, I've submitted this PR to be merged in 3.0 because IMO this is a bug fix, but we documented the deprecation and removal of the helper, what we should do here? (https://github.com/symfony/symfony/blob/3.0/UPGRADE-3.0.md#frameworkbundle and https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.7.md#frameworkbundle)

cc/ @wouterj

@@ -34,8 +34,7 @@

<service id="templating.helper.assets" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper">
Copy link
Member

Choose a reason for hiding this comment

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

wait, we still have the service definition for a class which does not exist ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stof
Copy link
Member

stof commented Dec 17, 2015

Actually, I think that the AssetsHelper should be updated to use the new system in 2.8 already

@dosten
Copy link
Contributor Author

dosten commented Dec 17, 2015

@stof Are you refering to the Asset component? Already in 2.8 we use the Asset component in the AssetsHelper and we provide a BC layer to keep the old behaviour. (see https://github.com/symfony/symfony/blob/2.8/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/AssetsHelper.php)

protected function tearDown()
{
$this->helper = null;
}
Copy link
Member

Choose a reason for hiding this comment

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

this has no real value (unless I'm missing something?), so I propose to remove it. If it does add something, I propose to move it just below setUp.

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, there's no value in this method. Let's remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, actually I'm using the same packages, so maybe we can use setUpBeforeClass here.

Copy link
Contributor

Choose a reason for hiding this comment

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

@dosten what for? Before each test setUp() is run and it sets a new value of the $helper property. There's no need for tearDown().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can use setUpBeforeClass because we use the same packages in each test, and remove the tearDown

@dosten
Copy link
Contributor Author

dosten commented Dec 28, 2015

@wouterj @jakzal comments addressed

@dosten
Copy link
Contributor Author

dosten commented Jan 4, 2016

Any news on this? can be merged? @fabpot

@psrpinto
Copy link
Contributor

psrpinto commented Jan 7, 2016

I just stumbled upon this issue, getting a PHP Fatal error: Class 'Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper' not found when using PHP templating.

As mentioned in the PR description, according to the upgrade guides, the templating.helper.assets service was removed in 3.0. Instead of adding back the AssetsHelper class, shouldn't the service definition be removed?

@dosten
Copy link
Contributor Author

dosten commented Jan 7, 2016

The UPGRADE file is wrong, in 3.0 the helper should provide integration with the Asset component.

@psrpinto
Copy link
Contributor

I just reviewed this PR and everything is fine, IMHO. Thanks for fixing this @dosten.

I'm also creating a PR to fix the upgrade guides since those need to be fixed in 2.7.

Status: Reviewed

@stof
Copy link
Member

stof commented Jan 19, 2016

👍

1 similar comment
@xabbuh
Copy link
Member

xabbuh commented Jan 19, 2016

👍

@fabpot
Copy link
Member

fabpot commented Jan 19, 2016

Thank you @dosten.

@fabpot fabpot merged commit 98cb838 into symfony:3.0 Jan 19, 2016
fabpot added a commit that referenced this pull request Jan 19, 2016
This PR was merged into the 3.0 branch.

Discussion
----------

[FrameworkBundle] Added the assets helper again

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

This PR is a follow up of #14972, we deprecated and removed the AssetsHelper in 2.7/3.0 doing impossible to use the Asset component and the PHP templates together, I've submitted this PR to be merged in 3.0 because IMO this is a bug fix, but we documented the deprecation and removal of the helper, what we should do here? (https://github.com/symfony/symfony/blob/3.0/UPGRADE-3.0.md#frameworkbundle and https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.7.md#frameworkbundle)

cc/ @wouterj

Commits
-------

98cb838 Added the assets helper again
fabpot added a commit that referenced this pull request Jan 19, 2016
…s removal of assets helper (regularjack)

This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Fix upgrade guides concerning erroneous removal of assets helper

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

As mentioned in #17041, the upgrade guides for 2.7 and 3.0 erroneously mention that the `templating.helper.assets` service is removed in 3.0.  #17041 cannot fix these issues since it targets 3.0.

This PR should only be merged after #17041 since it depends on it.

Commits
-------

5abac56 Fix upgrade guides concerning erroneous removal of assets helper
@dosten dosten deleted the framework-bundle/add-assets-helper branch January 19, 2016 23:24
@fabpot fabpot mentioned this pull request Feb 3, 2016
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

8 participants