8000 [FrameworkBundle] Config diff between 2.8 and 3.0. · Issue #16570 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
8000

[FrameworkBundle] Config diff between 2.8 and 3.0. #16570

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
ogizanagi opened this issue Nov 17, 2015 · 6 comments
Closed

[FrameworkBundle] Config diff between 2.8 and 3.0. #16570

ogizanagi opened this issue Nov 17, 2015 · 6 comments

Comments

@ogizanagi
Copy link
Contributor

Just to mention the issue we encountered while updating EasyAdminBundle for 3.0 support, keeping the exact same configuration (in tests):

framework:
    secret:          secret
    translator:      ~
    default_locale:  "%locale%"
    test:            ~
    router:          { resource: "%kernel.root_dir%/config/routing_base.yml" }
    form:            true
    validation:      { enable_annotations: true }
    templating:      { engines: ['twig'] }
    profiler:
        collect: true
    session:
        storage_id: session.storage.mock_file

This is the diff between the 2.8 and 3.0 processed configuration:

< array:23 [

---
> array:21 [
22,23c22,23
<       "enabled" => null
<       "field_name" => null

---
>       "enabled" => false
>       "field_name" => "_token"
47c47
<   "profiler" => array:8 [

---
>   "profiler" => array:5 [
53,55d52
<     "username" => ""
<     "password" => ""
<     "lifetime" => 86400
69,72d65
<   "csrf_protection" => array:2 [
<     "enabled" => false
<     "field_name" => "_token"
<   ]
99,105d91
<   "assets" => array:5 [
<     "version" => null
<     "version_format" => "%%s?%%s"
<     "base_path" => ""
<     "base_urls" => []
<     "packages" => []
<   ]
111c97

The issue we encountered was about the asset twig function, which isn't loaded in 3.0, because the framework.assets key doesn't have the "default values" it used to anymore, due to the framework bundle's Configuration class (the highlighted part is removed in 3.0).

I don't think it was mentioned anywhere. What do you think should be done about that ?

@csarrazi
Copy link
Contributor

It seems 3.0 is not the only version affected. See csarrazi/CsaGuzzleBundle#85

@xabbuh
Copy link
Member
xabbuh commented Jan 23, 2016

@csarrazi If I understand csarrazi/CsaGuzzleBundle#85 correctly, this was an issue caused by the user's code. Is that right?

@xabbuh
Copy link
Member
xabbuh commented Jan 23, 2016

@fabpot Assumed this is only different between Symfony 2.8 and 3.0 should we treat this as an intended BC break and thus document it in the upgrade files or do we have to fix the default config (I would say the latter as this is really unexpected for users as we never deprecated the old behaviour if I am not mistaken)?

@fabpot
Copy link
Member
fabpot commented Jan 23, 2016

Assets are disabled by default in 3.0, right? We can reenable it by default indeed to avoid such problems.

@csarrazi
Copy link
Contributor

Actually, it is a BC break from Symfony 2.7 to 2.8. By default, assets are disabled on both Symfony 2.8 and 3.0, which means one needs to add the framework.assets: ~ key in the configuration, for most bundles to work (if using the asset helper, which is the case most of the time).

@xabbuh
Copy link
Member
xabbuh commented Jan 23, 2016

I cannot reproduce the wrong behaviour on Symfony 2.8 (and the code you linked to is even from Symfony 2.8). For 3.0 and higher I opened a pull request to fix this (see #17506).

fabpot added a commit that referenced this issue Jan 25, 2016
… (xabbuh)

This PR was submitted for the master branch but it was merged into the 3.0 branch instead (closes #17506).

Discussion
----------

[FrameworkBundle] enable assets when templates are enabled

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

This puts back the default behavior of Symfony 2.8 where the Asset
component features were implicitly configured with sensible default
values when no explicit configuration was present but the templating
section was enabled.

Commits
-------

d0de425 enable assets when templates are enabled
@fabpot fabpot closed this as completed Jan 25, 2016
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

4 participants
0