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

[2.7][Asset] Ability to set empty version strategy in packages #16511

Merged
merged 1 commit into from Jan 24, 2016
Merged

[2.7][Asset] Ability to set empty version strategy in packages #16511

merged 1 commit into from Jan 24, 2016

Conversation

ewgRa
Copy link
Contributor

@ewgRa ewgRa commented Nov 10, 2015

Q A
Bug fix? yes
New feature? no
BC breaks? no, but not sure, as for me test was wrong
Deprecations? no
Tests pass? yes
Fixed tickets #14832
License MIT
Doc PR

Comment about '' thing. As you can see in xml test - we can't for attribute set null value. And for xml version '' empty string considered as null value, that affect all others formats and test is changed.

@ewgRa ewgRa changed the title Issue 14832 [2.7][Asset] Ability to set empty version strategy in packages Nov 10, 2015
@xabbuh
Copy link
Member

xabbuh commented Nov 12, 2015

Won't the version be null when you omitted the version attribute in the XML format (instead of setting it to an empty string)?

@ewgRa
Copy link
Contributor Author

ewgRa commented Nov 12, 2015

There is a case, if version is omitted - then default strategy used.

If we change it and if in xml omitted version considered as empty strategy (also as we need sync same logic for php, yml then) - we will have broken BC.

There is also legacy code (framework templating configuration) that have different logic - omitted considered as empty.

@ewgRa
Copy link
Contributor Author

ewgRa commented Nov 12, 2015

There is no possible to set attribute in xml to null as far as I know :(

@XWB
Copy link
Contributor

XWB commented Nov 24, 2015

Ping @fabpot Any feedback on this? This bug was introduced with Symfony 2.7 and has not been resolved yet.

@ewgRa
Copy link
Contributor Author

ewgRa commented Dec 9, 2015

ping @fabpot @xabbuh any comments?

@xabbuh xabbuh added the Asset label Jan 23, 2016
@fabpot
Copy link
Member

fabpot commented Jan 23, 2016

👍

@ewgRa Can you rebase to get rid of the 2 merge commit that prevents me from merging? Or even better, squash all commits. Thanks.

@ewgRa
Copy link
Contributor Author

ewgRa commented Jan 23, 2016

@fabpot done

@fabpot
Copy link
Member

fabpot commented Jan 24, 2016

Thank you @ewgRa.

@fabpot fabpot merged commit 646fc9c into symfony:2.7 Jan 24, 2016
fabpot added a commit that referenced this pull request Jan 24, 2016
…ages (ewgRa)

This PR was merged into the 2.7 branch.

Discussion
----------

[2.7][Asset] Ability to set empty version strategy in packages

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no, but not sure, as for me test was wrong
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14832
| License       | MIT
| Doc PR        |

Comment about '' thing. As you can see in xml test - we can't for attribute set null value. And for xml version '' empty string considered as null value, that affect all others formats and test is changed.

Commits
-------

646fc9c Ability to set empty version strategy in packages
@ewgRa ewgRa deleted the issue-14832 branch January 24, 2016 11:44
@@ -547,7 +553,12 @@ private function addAssetsSection(ArrayNodeDefinition $rootNode)
->prototype('array')
->fixXmlConfig('base_url')
->children()
->scalarNode('version')->defaultNull()->end()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fabpot Sorry, I accidently omit defaultNull here - fix #17514

fabpot added a commit that referenced this pull request Jan 25, 2016
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7][Asset] Add defaultNull to version configuration

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

In #16511 PR was omitted defaultNull version for one case.

Commits
-------

65adb72 add defaultNull to version
fabpot added a commit that referenced this pull request Jan 26, 2016
This PR was squashed before being merged into the 3.1-dev branch (closes #17532).

Discussion
----------

[Asset] Version as service

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

While I working on #14832 I realize that all this problems and hidden magic can be avoided, if we will have ability to set asset version strategy as service.

This PR implementation of this idea.

Now it is possible to do something like this:

```yaml
framework:
    assets:
        version_strategy: assets.custom_version_strategy
        base_urls: http://cdn.example.com
        packages:
            foo:
                base_urls: ["https://example.com"]
                version_strategy: assets.custom_version_strategy
```

There is can be some conflicts with #16511 when it will be in master

Commits
-------

52d116b [Asset] Version as service
@fabpot fabpot mentioned this pull request Feb 3, 2016
This was referenced Feb 28, 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

5 participants