From 035c4347008674399b390b7554bc0c519c16921d Mon Sep 17 00:00:00 2001 From: damaya Date: Fri, 3 Aug 2018 17:44:03 -0500 Subject: [PATCH] Support use of hyphen in asset package name | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes (Manual tests only) | Fixed tickets | #28122 | License | MIT | Doc PR | n/a According to issue https://github.com/symfony/symfony-docs/pull/10442, we tested in a demo bundle, for example in src/AppBundle/Resources/config/config.yml a package using hyphens: app-client-frontend, and withouth the patch it fails because the package is not recognized. With the patch, it works as expected. ``` framework: assets: packages: app-client-frontend: version: "%env(FRONTEND_VERSION)%" version_format: '%%2$s/dist/%%1$s' base_urls: - "%env(FRONTEND_URL)%" ``` --- .../Bundle/FrameworkBundle/DependencyInjection/Configuration.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index b1849afde8360..3335149d7f574 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -648,6 +648,7 @@ private function addAssetsSection(ArrayNodeDefinition $rootNode) ->fixXmlConfig('package') ->children() ->arrayNode('packages') + ->normalizeKeys(false) ->useAttributeAsKey('name') ->prototype('array') ->fixXmlConfig('base_url')